在一个绘图区域(图形)中绘制两个数据集

时间:2018-08-15 18:37:07

标签: python matplotlib plot colors

我有2个数据帧(train_df和test_df)。我想使用plt.plot函数将它们绘制在一张图中。

还希望这些数据集具有不同的颜色

尝试了多种方法,但未成功。下面是一个示例:

async componentDidMount() {
  try {
    const result = await this.props.runSearch(this.props.searchText);
  } catch (error) {
    // report error & show message
  }
}

我得到了2个不同的地块,而不是一个。

非常感谢您的帮助!

2 个答案:

答案 0 :(得分:2)

这应该做到:

_spotify.ResumePlayback(offset: "")

答案 1 :(得分:1)

您可以执行以下操作:

ax=plt.gca()
train_df.plot(figsize=(15,8), title="Sales", color='lime', ax=ax)
test_df.plot(figsize=(15,8), title="Sales", color='r',ax=ax)
plt.show()
相关问题