1
가하기 matplotlib로 작업 할 때이 잘 작동RC 변수는, 내가 라인을 설정하기 위해 노력하고있어
matplotlib.rc('lines', linewidth=0.5)
사용하여 그래프를 생성하는 웹 응용 프로그램에서하기 matplotlib에 대한 너비 웹 응용 프로그램에서 축 대화 형 모드에서,하지만 내 웹 응용 프로그램에서이 효과가 없습니다, 내가 올바른 라인 폭을 얻을 수있는 유일한 방법은, 개별 호출에 인수를 제공하는 것입니다 예 :
vals = map(itemgetter(1), sorted(series1.items(), reverse=True))
group1_rects = ax.barh(ind, vals, width, color='r', snap=True, linewidth=0.5)
vals = map(itemgetter(1), sorted(series2.items(), reverse=True))
group2_rects = ax.barh(ind+width, vals, width, color='b', linewidth=0.5)
는에 관련된 몇 가지 트릭이 있나요 웹 응용 프로그램에서 matplotlib.rc 호출이 작동하도록 만드시겠습니까?
이 같은 모습에 그릴 그림을 얻기를 위해 사용하고 코드 : 당신이 게시 한 무엇
@contextmanager
def render_plot(w=8,h=8):
fig = Figure(figsize=(w,h))
canvas = FigureCanvas(fig)
response.content_type = 'image/png'
#Here is where I hope to put RC settings
matplotlib.rc('lines', linewidth=0.5)
yield fig
s = StringIO()
canvas.print_figure(s)
response.content = s.getvalue()
matplotlib/pyplot 컨텍스트에서'rc'가 의미하는 바는 무엇입니까? – shailenTJ