In [1]:
import iris
import iris.quickplot as qplt

import matplotlib.pyplot as plt
%matplotlib inline

## IRIS Quickplot example -- Contour, fill, pcolormesh
##  Live 8.5  *  darkblue-b
##

In [2]:
## demo data of Sea Surface Temperatures as netCDF
file_path = '/usr/lib/python2.7/dist-packages/cartopy/data/netcdf/'
filename = 'HadISST1_SST_update.nc'
cubes = iris.load(file_path+filename)

In [3]:
## IRIS format - show a text description of the 0th cube

print 'Cubes defined: ' + str(len(cubes))
print cubes[0]


Cubes defined: 1
sea_surface_temperature / (degC)    (time: 1; latitude: 180; longitude: 360)
     Dimension coordinates:
          time                           x            -               -
          latitude                       -            x               -
          longitude                      -            -               x
     Attributes:
          Conventions: CF-1.0
          actual_range: [ -1.79999995  33.14212418]
          comment: Data restrictions: for academic research use only. Data are Crown copyright...
          contact: john.kennedy@metoffice.gov.uk
          description: HadISST 1.1 monthly average sea surface temperature
          history: 09/11/2006 HadISST converted to NetCDF from pp format by John Kennedy
          institution: Met Office, Hadley Centre for Climate Research
          references: Rayner, N. A., Parker, D. E., Horton, E. B., Folland, C. K., Alexander,...
          source: HadISST
          supplementary_information: Updates and supplementary information will be available from http://ww...
          title: Monthly version of HadISST sea surface temperature component
     Cell methods:
          mean: time, lat, lon

In [4]:
## store the 0th time slice of all lat,lon data points
sst0 = cubes[0][0,...]

In [5]:
##  IRIS Quickplot contour
##     http://scitools.org.uk/iris/docs/v1.6/iris/iris/quickplot.html#iris.quickplot.contour
contour = qplt.contour(sst0)

# Add coastlines to the map created by contour.
plt.gca().coastlines()

# Add contour labels based on the contour we have just created.
plt.clabel(contour)

plt.show()



In [6]:
## Filled polygons, values legend, continental interior legend
##  http://scitools.org.uk/iris/docs/v1.6/iris/iris/quickplot.html#iris.quickplot.contour

qplt.contourf(sst0)
plt.gca().stock_img()
plt.gca().coastlines()


Out[6]:
<cartopy.mpl.feature_artist.FeatureArtist at 0xad53e74c>

In [8]:
## Pseudocolor Mesh
##  http://scitools.org.uk/iris/docs/v1.6/iris/iris/quickplot.html#iris.quickplot.pcolormesh

qplt.pcolormesh(sst0)
plt.gca().stock_img()
plt.gca().coastlines()


Out[8]:
<cartopy.mpl.feature_artist.FeatureArtist at 0xacfd45ec>

In [ ]: