python - 图表标题一一打印
问题描述
图表标题被一一打印。我怎么解决这个问题??
这是我的代码。
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, 90001622]
最后打印(i)
90001302 90001341 90001441 90001443 90001521 90001541 90001542 90001582 90001602 90001622
但是图形像这张图片一样打印。
10 个图中有 10 个标题,但实际上 10 个图中只输出了 9 个标题。
请帮助..
解决方案
推荐阅读
- regex - 在两场比赛之间使用非捕获组?
- mysql - 触发器如何用于表中的删除事件?将删除的记录插入另一个表时是否存在原子性?
- python-3.x - 句子中单个字符串的正则表达式?
- google-cloud-platform - gcloud pubsub 订阅 pull 经常报空消息列表
- profiling - lcov genhtml“未找到数据”问题
- python - 当每个键有多个值时,根据值获取键列表
- php - 为什么我的phpinfo上没有显示mongodb?
- visual-studio - 使用 '.NETFramework,Version=v4.6.1' 而不是项目目标框架 '.NETCoreApp,Version=v2.0' 恢复?
- angular - 两个列表的分页
- python-3.x - 结果中的 Pandas Groupby 列