'AxesSubplot' object has no attribute 'get_axis_bgcolor'

这一生的挚爱 提交于 2019-12-21 22:40:28

问题


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

I am using: -Python 3.5.5 -Matplotlib 2.2.2

Would appreciate any help.


回答1:


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.

There are instances in the following two functions drawmapboundary() and fillcontinents().

Save the edits, then re-start and run the python script.



来源:https://stackoverflow.com/questions/50691151/axessubplot-object-has-no-attribute-get-axis-bgcolor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!