`pcolormesh` breaks with most recent `matplotlib` version
See original GitHub issueDescribe 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:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think just need cartopy==0.18
Addressed in #451