python - 获取 matplotlib.collections.PolyCollection 的轴
问题描述
我想获得 a 的轴matplotlib.collections.PolyCollection
。如果 pc 是这样一个对象,运行下面的代码:
ax = pc.axes.get_xaxis()
虽然我的代码之前一直在工作,但我遇到了以下警告:
MatplotlibDeprecationWarning: get_axes 在 mpl 1.5 中已被弃用,请使用 axes 属性。移除日期尚未确定。
但是现在我在运行相同的程序时遇到了这个错误:
“PolyCollection”对象没有属性“get_axes”
get_axes 折旧后如何获得轴?
解决方案
您提到的警告建议改用 axes 属性。查看文档,axes 是现有属性,而 get_axes 不是。它应该按预期返回 Axes 实例。
推荐阅读
- flutter - Riverpod - 获取当前用户的状态通知器始终为空
- c# - 为什么我得到不同的结果?
- agora.io - 在群聊的远程视频上显示用户名,群聊的举手功能
- java - 一台服务器上的多个 ehcache 会互相污染吗?
- apache-camel - 使用数据库在集群中运行的 Apache Camel 单个路由实例
- assembly - 翻转时两个无符号变量之间的差异
- google-sheets - 公共只读 Google Sheets API 的最低权限 API 密钥配置是什么?
- bash - 使用 pandoc 将 epub/pdf(和其他文本文件)的目录转换为 .txt
- rust - 不应该弧
为任何 T 实现克隆? - excel - NIFI excel文件