【发布时间】:2018-08-10 18:21:50
【问题描述】:
我有多个数据集需要绘制在相同的轴上。 数据集的一个示例是: 数据集 01 作为两个单独的列表:
Waves Values
340 520
341 532
342 536
. .
. .
2500 720
Dataset 02 作为数据框 df:
Wavelength Data
320 560
350 572
. .
. .
2650 780
我对剧情的尝试如下:
fig,ax=plt.subplots(figsize=(15, 10))
ax = plt.plot(x = Waves , y = Values) # list names
df.plot(ax=ax, x='Wavelength', y='Data')
plt.show()
我收到以下错误:
AttributeError: 'list' object has no attribute 'get_figure'
【问题讨论】:
标签: python python-3.x pandas dataframe matplotlib