3
다음과 같이 차트를 작성해야합니다. 이미지와 같이 x 축에 날짜를 표시해야합니다. matplotlib x 레이블 배치
는하지만 난 단지 다음과 같이 차트를 생성 할 수 있었다.나는 수직으로 회전 또는 표시 라벨을 추가 할 수 있습니다 알고이 차트
fig, ax = plt.subplots()
ax.plot(numpyTradeData.date, numpyTradeData.adj_close)
#Add Text in Grap
ax.text(0.5,0.1, 'Class Period\n %s - %s'%(clsStartPeriod.strftime('%B %d,
%Y'),clsEndPeriod.strftime('%B %d, %Y')),
horizontalalignment='center',
fontsize=9, color='red',
transform=ax.transAxes)
#Fill An Area in Graph
ax.fill_between(numpyTradeData.date[classStartPeriodIndex:classEndPeriodIndex], 0, numpyTradeData.adj_close[classStartPeriodIndex:classEndPeriodIndex], facecolor='0.9', alpha='0.5')
ax.xaxis.set_major_locator(LinearLocator(numticks=5))
ax.xaxis.set_major_formatter(dateStrFormatter)
ax.set_xlim(minDate,maxDate)
ax.set_ylabel('Share Price')
formatter = FuncFormatter(self.addDollarSymbol)
ax.yaxis.set_major_formatter(formatter)
fig.autofmt_xdate()
을 생성하기 위해 사용하는 코드를 참조하십시오. 그러나 첫 번째 이미지에서와 같이 레이블을 표시하는 방법을 알아낼 수 없었습니다.
고마워요 ... – Nick