【发布时间】:2019-11-27 03:00:42
【问题描述】:
我有每日平均温度、降水量和全球辐射的气候时间序列图。 我生成了这样的图: https://i.ibb.co/w4x2FMN/temp-mean-1999-2018.png
在 x 轴上,我刚刚生成了代表年份 (DOY) 的数字 1 - 365 的列表。
我真正想要的是,x 轴按月份名称(作为字符串)划分,如下所示: https://i.ibb.co/cL2zc87/rplot.jpg
我已经尝试了很多不同的东西,但没有任何效果。
fig = plt.figure(figsize=(10,10))
ax = plt.axes()
x = np.arange(1,366) # here I define the List with DOY
ax.fill_between(x, temp_cum['min'], temp_cum['max'], color='lightgray', label='1999-2017')
#ax.plot(x, merge_table_99_17_without, color='grey', linewidth=0.3)
ax.plot(x, temp_cum['2018'], color='black', label='2018');
ax.legend(loc='upper left')
ax.set_ylabel('daily mean temperature [°C]')
#ax.set_xlabel('DOY')
plt.show()
【问题讨论】:
标签: python pandas matplotlib plot time-series