[英]Plot Column from different dataframe into one chart of lines
I have two dataframes with the same headers.我有两个具有相同标题的数据框。 I want to plot the 'Close' column from both data frames into one chart of lines.我想将两个数据帧中的“关闭”列 plot 转换为一张折线图。
so I have:所以我有:
(aapl.Close).plot()
and和
(tsla.Close).plot()
which clearly does what I need to plot but in two different charts.这显然可以满足我对 plot 的要求,但在两个不同的图表中。 I need two lines in one line chart.我需要在一个折线图中有两条线。
Tried the below, literally after I posted.在我发布之后尝试了以下内容。
fig = plt.figure() ax = fig.add_subplot() fig = plt.figure() ax = fig.add_subplot()
ax.plot(aapl.Close) ax.plot(tsla.Close) ax.plot(aapl.Close) ax.plot(tsla.Close)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.