自定义刻度在 pyplot 中表现得很奇怪

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

我有下面的数据框,我想在 x 轴上有自定义刻度,如 [0 1 ... 23]。但是当我执行 plt.customticks 时,所有刻度线都被挤压到左侧。如何将它们平均放置?

可用的时间戳容量 0 03/05/2023 00:55:16 19 15 1 03/05/2023 00:56:16 19 15 2 03/05/2023 00:57:16 19 15 3 03/05/2023 00:58:17 19 15 4 03/05/2023 00:59:17 19 15

试过plt.xticks(列表(范围(0,23))

pandas matplotlib datetime plot axis-labels
© www.soinside.com 2019 - 2024. All rights reserved.