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]
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]:
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]:
In [ ]: