类型错误:set_ticks() 得到了意外的关键字参数“标签”

tim*_*imo 10 python matplotlib

我正在尝试从以下位置运行热图示例: https: //matplotlib.org/stable/gallery/images_contours_and_fields/image_annotated_heatmap.html

当我在 Anaconda3 环境中的 PyCharm(专业版)中运行代码时,会出现错误消息。

类型错误:set_ticks() 得到了意外的关键字参数“标签”

Sha*_*hta 8

如果您使用的是 matplotlib 3.4.3 版本,则无需更新 matplotlib 版本。

这是 matplotlib 3.4.3文档的链接,并避免在函数中使用 labels 关键字,ax.set_xticks()如 JohnC 所说