Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cartopy incompatibility with new matplotlib 3.3.0 #1615

Closed
bradyrx opened this issue Jul 25, 2020 · 2 comments
Closed

Cartopy incompatibility with new matplotlib 3.3.0 #1615

bradyrx opened this issue Jul 25, 2020 · 2 comments

Comments

@bradyrx
Copy link

bradyrx commented Jul 25, 2020

Description

It looks like there's an incompatibility between cartopy 0.17.0 and the new matplotlib 3.3.0. See the bottom of https://travis-ci.com/github/bradyrx/climpred/builds/176836907.

---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

<ipython-input-3-9e314160e532> in <module>

      1 ax = plt.axes(projection=ccrs.Orthographic(-80, 0))

      2 p = ax.pcolormesh(recon.TLONG, recon.TLAT, recon.mean('time'), 

----> 3               transform=ccrs.PlateCarree(), cmap='twilight')

      4 ax.add_feature(cfeature.LAND, color='#d3d3d3')

      5 ax.set_global()

~/miniconda/envs/climpred-dev/lib/python3.6/site-packages/cartopy/mpl/geoaxes.py in pcolormesh(self, *args, **kwargs)

   1457                              ' consider using PlateCarree/RotatedPole.')

   1458         kwargs.setdefault('transform', t)

-> 1459         result = self._pcolormesh_patched(*args, **kwargs)

   1460         self.autoscale_view()

   1461         return result

~/miniconda/envs/climpred-dev/lib/python3.6/site-packages/cartopy/mpl/geoaxes.py in _pcolormesh_patched(self, *args, **kwargs)

   1489         allmatch = (shading == 'gouraud')

   1490 

-> 1491         X, Y, C = self._pcolorargs('pcolormesh', *args, allmatch=allmatch)

   1492         Ny, Nx = X.shape

   1493 

TypeError: _pcolorargs() got an unexpected keyword argument 'allmatch'

TypeError: _pcolorargs() got an unexpected keyword argument 'allmatch'

It looks like cartopy is using the keyword allmatch which must have been dropped, although it's not mentioned in the changelog for matplotlib. We fixed this issue by forcing matplotlib <= 3.2.2 in our docs for now.

@greglucas
Copy link
Contributor

Yes, Cartopy is using some private functions from MPL in the pcolormesh function, so that change wasn't announced in the MPL release. The fix is in Cartopy 0.18, so try to upgrade if you can. This is the commit.

@QuLogic
Copy link
Member

QuLogic commented Jul 25, 2020

Closing as fixed in 0.18.0; there's nothing we can do about 0.17.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants