【发布时间】:2014-05-29 16:42:52
【问题描述】:
我有一个以日期为 x 轴的图。但是我左右都有很多空间,我想在每个日期之间获得更宽的空间,以填充整个空间(宽度)。现在看起来像这样:
我的代码是:
ticks = np.arange(0, len(year_month), 1)
labels = year_month
mng = plt.get_current_fig_manager()
mng.window.state('zoomed') #works fine on Windows
plt.xlabel('Date')
plt.xticks(ticks, labels, rotation='vertical')
plt.ylabel('Sentiment')
plt.legend()
plt.grid()
plt.show()
【问题讨论】:
-
@flebool 你可以发表你的评论作为答案...
标签: python matplotlib plot width axis-labels