matplotlib / basemap

Plot on map projections (with coastlines and political boundaries) using matplotlib
MIT License
779 stars 392 forks source link

AxesSubplot issue #393

Closed gaelCc closed 6 years ago

gaelCc commented 6 years ago

I am using basemap via conda environment. When i want to do a simple plot like:

from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np

my_map = Basemap(projection='ortho', lat_0=50, lon_0=-100,
              resolution='l', area_thresh=1000.0)

my_map.drawcoastlines()
plt.show()

It throws the error AttributeError: 'AxesSubplot' object has no attribute 'get_axis_bgcolor'

I've read in previous posts that this issue was well known and fixed, but i cannot make it work. What could I do?

(to install basemap i've followed these instructions here )

ocefpaf commented 6 years ago

I believe you are getting a really outdated basemap from defaults. Try the conda-forge version:

$ conda install --channel conda-forge basemap basemap-data-hires

note that in conda-forge the high resolution data is a separate package, if you don't need it you can install a the slimmer version with just conda install --channel conda-forge basemap.

gaelCc commented 6 years ago

That was the problem! Thank you very much. I was using version 1.0.7