【发布时间】:2015-05-11 00:23:08
【问题描述】:
我有一组对应于一个月和一年(2012 年 1 月、2012 年 3 月、2012 年 10 月到 2014 年)的值,我试图绘制每个月的值,但是当我运行脚本时 x轴被分配为'1、2、3'等
import numpy as np
import matplotlib.pyplot as plt
plt.plot([10, 180, 153, 80, 11, 92, 201, 74, 24])
plt.ylabel('Value')
plt.xlabel('Time')
plt.title('Number over time')
plt.show()
plt.ylim([0,300])
plt.show()
如何将 X 轴设置为这些特定月份或 2011-2014 年的所有月份?
我发现 matplotlib 中的演示图非常令人困惑 http://matplotlib.org/examples/pylab_examples/date_demo1.html
【问题讨论】:
标签: python numpy time graph plot