Cartopy

Previous topic

Drawing a geodetic polygon

Next topic

Drawing images

This Page

Drawing contoursΒΆ

import matplotlib.pyplot as plt
import cartopy.crs as ccrs
from cartopy.examples.waves import sample_data

ax = plt.axes(projection=ccrs.Robinson())

ax.set_global()

lons, lats, data = sample_data(shape=(20, 40))

plt.contourf(lons, lats, data, transform=ccrs.PlateCarree())

ax.coastlines()
ax.gridlines()

plt.show()

(Source code, png)

../../_images/03-contours-1.png