[英]Python Plot day time on x-axis for many years of data
I am plotting many years of data.我正在绘制多年的数据。 On the x-axis, I am plotting time of the day and on y-axis the value.在 x 轴上,我正在绘制一天中的时间,在 y 轴上绘制值。 The problem is x-axis ticks builtup together, not visible.问题是 x 轴刻度组合在一起,不可见。 How do I solve it?我该如何解决?
plt.plot(df.index.strftime('%H:%M'),df['ydata'],'.')#hour+ssdf.index.minute/60
plt.gcf().autofmt_xdate()
plt.show()
In the above plot, I wanted to see the x-axis ticks show 00:00, 02:00, etc.在上图中,我想看到 x 轴刻度显示 00:00、02:00 等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.