首页 > 解决方案 > 如何在 matploblib 中指定分类单位

问题描述

我有一些看起来像这样的代码:

ax.bar(x, y, label=label, alpha=0.5)

问题是它会INFO向我的日志发出这种烦人的东西,并且(我认为)有时会更改我的标签。这很烦人,因为它位于更大程序的内部循环中。我宁愿不抑制 matploblib 消息,因为我是新手,不想错过任何东西。

Using categorical units to plot a list of strings that are all parsable as floats or dates. If these strings should be plotted as numbers, cast to the appropriate data type before plotting.

有没有办法告诉 matplotlib 不要更改我的标签或警告我,即使它们看起来像数字(即,不更改我的标签)?

标签: matplotlib

解决方案


推荐阅读