圖表標題一一列印。我怎么解決這個問題??
這是我的代碼。
plt.figure(figsize=(25,10))
plt.subplots_adjust(left=0.125, bottom=0.1, right=0.9, top=0.9, wspace=0.2, hspace=0.4)
n = 1
for idx, i in enumerate(top_10_df_event_copy['Code'].unique()):
top_10_df_event_copy_list[i] = pd.Series(winsorize(top_10_df_event_copy_list[i].values, limits=[0, 0.1]))
stl = seasonal_decompose(top_10_df_event_copy_list[i].values, freq=3)
plt.title(f"{i}", fontsize=15)
ax = plt.subplot(4,3,n)
ax.plot(stl.seasonal stl.trend)
ax.plot(stl.observed, color='red', alpha=0.5)
n = 1
print(i)
plt.show()
i = [90001302, 90001341, 90001441, 90001443, 90001521, 90001541, 90001542, 90001582, 90001602, 22001]
最后列印(i)
90001302 90001341 90001441 90001443 90001521 90001541 90001542 90001582 90001602 90001622
但圖形是這樣列印的。
10張圖中有10個標題,但實際上10張圖中只輸出了9個標題。
請幫忙..

轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/342643.html
標籤:Python matplotlib
上一篇:對數刻度機智matplotlib中的x-ticks問題
下一篇:如何在條形圖中添加單個標記
