我试着画出时间(x轴)和流动(y轴)。我的数据系列“时间”是一年中的几天,但它从1到365。有没有办法让图显示在x轴上的天/月(所以1月1日是1-1,2月1日是1-2,…,12月1日是1-12),而不是1,2,3,4,5一直到365天?还是需要添加另一列日期?在
from matplotlib import pyplot
enter code from matplotlib import pyplot
from math import log
time = list(mom6[0])
flow = list(mom6[1])
pyplot.scatter(x,y,linestyle = '--')
pyplot.ylabel('Flow (cfs)')
pyplot.xlabel('Time')
pyplot.title('Flow Duration')
pyplot.yscale('log')
plt.grid(True)
plt.show()here
也是为了散点图(x,y,linestyle='-')它不会连接点。我的数组看起来像:
^{pr2}$最佳
可以使用datetime进行转换:
(用于在
time = list(mom6[0])
之后插入):结果:
^{pr2}$相关问题 更多 >
编程相关推荐