I’d like to plot contours over a map produced with cartopy. If I run the example at:
http://scitools.org.uk/cartopy/docs/latest/matplotlib/introductory_examples/03.contours.html
using a checkout of the latest code from github I get:
ValueError: invalid transform: Spherical contouring is not supported -
consider using PlateCarree/RotatedPole.
How should one do this?
(asked as a response to the original announcement http://matplotlib.1069221.n5.nabble.com/ANN-Cartopy-A-new-mapping-library-using-matplotlib-td39886.html)
The examples provided in the cartopy docs under
http://scitools.org.uk/cartopy/docs/latest/matplotlib/introductory_examplesare out of date compared to the codebase. There is a development ticket to update all of the examples (https://github.com/SciTools/cartopy/issues/128).In this case, simply replace the line
with
and the example should work again.
The matplotlib/cartopy introductory section of the cartopy docs has
has a contouring example which may be of interest http://scitools.org.uk/cartopy/docs/latest/matplotlib/advanced_plotting.html#contour-plots
The resulting image:
HTH,