【发布时间】:2021-10-24 08:47:25
【问题描述】:
我想在直方图上绘制每小时桶,例如0-1、1-2、2-3 等等。
我所拥有的很简单0、1、2、3 ... 小时绘制在 x 轴上。我也需要将其更改为0-1、1-2、2-3.. 小时等等
不胜感激。
【问题讨论】:
-
搜索“xticklabels”,你只需要重新定义你的标签形式为“x--(x+1)”
-
这不是直方图,而是条形图。
-
你试过什么? SO 不是编码服务。请阅读以下文档,然后阅读edit,并重新表述问题。 Take the Tour、How to ask a good question 和 On Topic。始终提供带有代码、数据、错误、当前和预期输出的minimal reproducible example,如formatted text,您应该try to solve the problem first 并展示您的努力。
标签: python datetime matplotlib plot bar-chart