'AxesSubplot'对象没有属性'get_axis_bgcolor' [英] 'AxesSubplot' object has no attribute 'get_axis_bgcolor'

查看:610
本文介绍了'AxesSubplot'对象没有属性'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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆