将不同数据框中的图列绘制成一个折线图

问题描述 投票:0回答:1

我有两个具有相同标题的数据框。我想将两个数据框中的“关闭”列绘制成一个折线图。

所以我有:

(aapl.Close).plot()

(tsla.Close).plot()

这显然可以完成我需要绘制的内容,但要在两个不同的图表中进行绘制。我在一个折线图中需要两条线。

python pandas plot
1个回答
0
投票

[在我发布后,确实尝试了以下内容。

fig = plt.figure()ax = fig.add_subplot()

ax.plot(aapl.Close)ax.plot(tsla.Close)

© www.soinside.com 2019 - 2024. All rights reserved.