question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`pcolormesh` breaks with most recent `matplotlib` version

See original GitHub issue

Describe the bug With matplotlib set to most recent version in requirements.txt, we get the following error in the tropical-pacific-ssts notebook:

Notebook error:

CellExecutionError in examples/decadal/tropical-pacific-ssts.ipynb:

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

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

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

              transform=ccrs.PlateCarree(), cmap='twilight')

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

ax.set_global()

plt.colorbar(p, label='Sea Surface Temperature [degC]')

ax.set(title='Example Data Coverage')

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

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

TypeError                                 Traceback (most recent call last)

<ipython-input-1-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'

Interestingly, this is due to the main requirements.txt file, not the docs file. Don’t have time now to investigate this, but would be good to not force an earlier version of matplotlib for the main install.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
ahuang11commented, Sep 20, 2020

I think just need cartopy==0.18

0reactions
bradyrxcommented, Sep 24, 2020

Addressed in #451

Read more comments on GitHub >

github_iconTop Results From Across the Web

pcolormesh — Matplotlib 3.6.2 documentation
Shows how to combine Normalization and Colormap instances to draw "levels" in axes.Axes.pcolor , axes.Axes.pcolormesh and axes.Axes.imshow type plots in a ...
Read more >
matplotlib's pcolormesh does not update during animation ...
Note: I'm using OSX which apparenlty has some issues with the blit option. import matplotlib.pyplot as plt import numpy as np import matplotlib....
Read more >
Chapter 4. Visualization with Matplotlib - O'Reilly
Matplotlib is a multiplatform data visualization library built on NumPy arrays, … ... Recent Matplotlib versions make it relatively easy to set new...
Read more >
Using multiple blocks — animatplot 0.4.1 documentation
%matplotlib notebook import numpy as np import matplotlib.pyplot as plt import animatplot as amp. We are going to plot a pcolormesh and a...
Read more >
Colormap Examples - PyHOGS
Matplotlib comes with a large set of default colormaps, illustrated here. Most (all?) of the default colormaps also have a reversed version, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found