Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 使用数据的matplotlib的图形视图_Python 3.x_Matplotlib - Fatal编程技术网

Python 3.x 使用数据的matplotlib的图形视图

Python 3.x 使用数据的matplotlib的图形视图,python-3.x,matplotlib,Python 3.x,Matplotlib,我试图从我的数据中预测一些值,为此我做了一个图表,以了解数据的模式。然而,我的图表看起来很奇怪和不同。我使用这段代码来生成图形 rolmean=dtf.rolling(window=5).mean() rolstd=dtf.rolling(window=5).std() print(rolmean, rolstd) #plot rolling statistics: orig = plt.plot(dtf, color='blue', label='original') mean = pl

我试图从我的数据中预测一些值,为此我做了一个图表,以了解数据的模式。然而,我的图表看起来很奇怪和不同。我使用这段代码来生成图形

rolmean=dtf.rolling(window=5).mean()

rolstd=dtf.rolling(window=5).std()
print(rolmean, rolstd)

#plot rolling statistics:

orig = plt.plot(dtf, color='blue', label='original')
mean = plt.plot(dtf, color='red', label='rolling mean')
std = plt.plot(dtf,color='black', label='rolling std')
plt.legend(loc='best')
plt.title("Rolling mean & standard deviation")
plt.show(block=False)
plt.pause(3)
这是我的图表的外观:

我的值很大,所以我应该更改图形中轴的值吗?
谢谢

所有东西看起来都是黑色的原因是,你画了3次相同的值,在同一个地方用不同的颜色绘制了3次,只有最后一个才可见。前后移动的线条是由于x轴上的值未被排序所致。试着使用熊猫,或者海洋生物。