1

The problem is exactly the same as the one reported here and using the same code:

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

plt.figure(figsize=(8, 8))
m = Basemap(projection='ortho', resolution=None, lat_0=50, lon_0=-100)
m.bluemarble(scale=0.5)
plt.show()

This results in the same empty circle. I do get a warning:

Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).

which results from the input data to imshow() being all zero. If I run the code without the projection

m = Basemap(resolution=None, lat_0=50, lon_0=-100)

I get (rather badly drawn) map of the world, which suggests to me that all the libraries are installed.

I think the data gets zeroed out with the code here from mpl_toolkits\basemap\__init__.py but as I don't understand what it's doing it doesn't help me much:

self._bm_rgba_warped = \
ma.masked_array(self._bm_rgba_warped,mask=mask)
# make points outside projection limb transparent.
self._bm_rgba_warped = self._bm_rgba_warped.filled(0.)

Any suggestions as to how to proceed?

1 Answer 1

0

Had the same issue in google colab and did this:

!pip uninstall matplotlib
!pip install matplotlib==3.4.3

Then it worked. Found solution in comment here which had a link to here. Basically there's a bug in 3.5 and higher versions of matplot lib that causes the clipping.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.