1
플롯 창이 닫힌 후 사용자 선택에 따라 플롯 제목을 변경하고 싶습니다.플롯 윈도우가 파이썬에서 닫힌 후 플롯 제목을 설정하는 방법
ax = pd.rolling_mean(dataToPlot_plot[startTime:endTime][['plotValue']],mar).plot(linestyle='-', linewidth=3, markersize=9, color='#FECB00')
ax.legend().set_visible(False)
titObj = plt.title('Data Plot - '+"\n", fontsize=13)#plot title
plt.show()#showing the plot
fig = ax.get_figure()
fig.set_size_inches(12, 6)
fig.savefig(savePlot)
은 지금인가,
ax = pd.rolling_mean(dataToPlot_plot[startTime:endTime][['plotValue']],mar).plot(linestyle='-', linewidth=3, markersize=9, color='#FECB00')
ax.legend().set_visible(False)
titObj = plt.title('Data Plot - '+"\n", fontsize=13)#plot title
plt.show()#showing the plot
curVal = ax.get_xlim()
stdate = int(curVal[0])
endate = int(curVal[1])
difdate = endate - stdate
fig = ax.get_figure()
if stdate > 0 and endate > 0:
if difdate > 365:
newplotTitle = 'Data Plot - Since from start'
elif difdate > 28 and difdate < 365:
newplotTitle = 'Data Plot - Past Month'
elif difdate < 28:
newplotTitle = 'Data Plot - Past Days'
plt.title(newplotTitle+"\n", fontsize=13)#plot title
fig.set_size_inches(12, 6)
fig.savefig(savePlot)
새로운 변화
이전 제목으로 개정되지 ... 동적으로 플롯 제목을 변경 플롯의 사용자 선택에 따라와 저장이 모든 필요 이 문제를 해결하는 다른 방법 ... 미리 감사드립니다 ...
감사합니다. @Joe Kington, 큰 도움이되었습니다 ... "fig.suptitle (newplotTitle +"\ n ", fontsize = 13) #plot title"이 작동했습니다. 시간과 도움에 감사드립니다. –