'AxesSubplot'对象没有属性'get_axis_bgcolor' [英] 'AxesSubplot' object has no attribute 'get_axis_bgcolor'
问题描述
我正在尝试从此处运行底图示例,并且遇到错误"AxesSubplot"对象没有属性"get_axis_bgcolor".当我从站点尝试第一个示例时,应该收到黑色,水蓝色和陆地珊瑚的轮廓,但在我的情况下,边界为黑色,但是水和陆地均为蓝色
I am trying to run Basemap examples from here and I am facing an error 'AxesSubplot' object has no attribute 'get_axis_bgcolor'. When I try first example from the site I should receive contours black, water blue and land coral, but in my case boundaries are black but both water and land are blue
我正在使用: -Python 3.5.5 -Matplotlib 2.2.2
I am using: -Python 3.5.5 -Matplotlib 2.2.2
非常感谢您的帮助.
推荐答案
Basemap
(甚至当前最新版本为1.0.7)正在使用不推荐使用的Matplotlib
命令(请参阅:
Basemap
(even current latest version 1.0.7) is using deprecated Matplotlib
command (see: matplotlib.org/api/_as_gen/…). This command ax.get_axis_bgcolor()
needs to be replaced by ax.get_fc()
in the file __init__.py
found in the ...\lib\pythonX.X\site-packaged\mpl_toolkits\basemap
directory.
以下两个功能 drawmapboundary()
和 fillcontinents()
中有实例.
There are instances in the following two functions drawmapboundary()
and fillcontinents()
.
保存编辑,然后重新启动并运行python脚本.
Save the edits, then re-start and run the python script.
这篇关于'AxesSubplot'对象没有属性'get_axis_bgcolor'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!