我从一个模拟中得到了一些数据,这些数据存储在一个数据帧中(100行x 6列)。对于不同的起始值,我将数据保存在一个面板中(2个数据帧x 100行x 6列)。在
现在我要比较两个模拟中名为“A”的列(名为“Sim1”和“Sim2”)的比较方式,一种方法是通过数据帧.plot命令
Panel['Sim1'].plot(x = 'xvalues', y='A')
Panel['Sim2'].plot(x = 'xvalues', y='A')
plt.show()
这是可行的,但是我觉得它应该是可能的,就像da数据在同一个数据帧中一样,我可以这样绘制
^{pr2}$如果数据存储在一个面板中,我是否遗漏了什么,或者仅仅是不可能用一个命令将两个图形绘制成一个图形?在
考虑以下示例:
策划一下
^{pr2}$示例面板的不同切片/索引/选择示例:
按项目轴(索引):
按主轴:
通过短轴:
在您的情况下(取决于轴),您可能需要以不同的方式分割面板:
这里有一种方法,使用^{} 。
apply(plt.plot)
的输出是Line2D对象的minor_axis
-by-items
数据帧。plot()
试图绘制一个对我们的目的来说没有实际意义的额外维度,但是我们可以使用lines.pop()
来删除有问题的维度。希望这有帮助。在相关问题 更多 >
编程相关推荐