Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.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 绘制熊猫vs matplotlib_Python_Pandas_Matplotlib - Fatal编程技术网

Python 绘制熊猫vs matplotlib

Python 绘制熊猫vs matplotlib,python,pandas,matplotlib,Python,Pandas,Matplotlib,对于jupyter笔记本小部件,我尝试了以下方法: with output: fig, ax = plt.subplots(constrained_layout=True, figsize=(6, 4)) # move the toolbar to the bottom fig.canvas.toolbar_position = 'bottom' ax.grid(True) line, = ax.plot(df.index, init_data, initial_colo

对于jupyter笔记本小部件,我尝试了以下方法:

with output:
    fig, ax = plt.subplots(constrained_layout=True, figsize=(6, 4))
     
# move the toolbar to the bottom
fig.canvas.toolbar_position = 'bottom'
ax.grid(True)  
line, = ax.plot(df.index, init_data, initial_color,)
ax.set_ylabel('CH4_HYD1')
ax.set_ylabel('')
但是数据是以一种更为复杂的方式绘制出来的。隔离打印方法并将其与pandas默认值进行比较时,pandas打印将正确显示数据

df['CH4_HYD1'].plot()
熊猫阴谋

错误的阴谋?


我想使用轴绘图方法生成具有多条不同特征线的绘图。但我找不到可能非常简单的错误。。。这里的区别是什么?

这是一个简短的示例,说明了如何使用matplotlib和pandas从数据帧绘制多行。本质上,熊猫使用matplotlib进行绘图,因此不会有什么不同


不管怎样,我鼓励你调查一下。这是一个基于pandas和matplotlib的很棒的库,可以方便地可视化数据帧。

您也可以上传数据帧吗?索引似乎有问题。默认设置是什么?你的意见是什么?请阅读并编辑问题。嘿,谢谢,索引中有一个错误,我搞砸了。谢谢你的提示!我怎么才能结束这样的问题?嘿,谢谢,索引中有个错误,我把它搞糟了。谢谢你的提示!
plt.plot(['CH4_HYD1'])