【问题标题】:How to combine different graphs and plot it in only one graph?如何组合不同的图表并将其绘制在一张图表中?
【发布时间】:2019-10-24 11:21:46
【问题描述】:

我的数据包括每天和每天每分钟的汽车数量。例如,我知道如何仅绘制八月某一天的数据。但是,我不知道如何绘制其他月份并将它们全部放在一张图中。

谁能帮帮我?

Here is a small sample of my data

Final Photo: it is what I have achieved, but do not know how to add legend for them and how to change the color or change the shape of graphs

提前致谢

【问题讨论】:

  • 请分享您的相关代码。
  • 如果当前答案不充分,请将代码编辑到您的问题中,并提供比该图像更多的上下文。

标签: python-3.x matplotlib jupyter-notebook data-analysis


【解决方案1】:

如果你使用 pyplot,你可以使用.plot() 方法。

【讨论】:

  • 你可以吗?如果您每天有 1 个值,那很好,但它也支持小时数吗?
  • 前两个参数是 numpy 数组。你应该只给它 x 和 y 值,你可以提供一个标签来表示月份。
  • 是的,它也支持小时。请查看照片以更好地理解。提前感谢您的帮助@Guimute
  • 请看我上传的照片。我知道如何绘制数据,但我只想将整个月都放在一个图表中,而不是单独的图表中。 @Gloweye
  • 我需要看到更多你的代码才能到达那里,@Alisha
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-08-05
相关资源
最近更新 更多