iris.plot¶
Irisspecific extensions to matplotlib, mimicking the matplotlib.pyplot
interface.
See also: matplotlib.
In this module:

iris.plot.
citation
(text, figure=None, axes=None)¶ Add a text citation to a plot.
Places an anchored text citation in the bottom right hand corner of the plot.
Args:
 text:
 Citation text to be plotted.
Kwargs:
 figure:
 Target
matplotlib.figure.Figure
instance. Defaults to the current figure if none provided.
 axes: the
matplotlib.axes.Axes
to use for drawing.  Defaults to the current axes if none provided.
 axes: the

iris.plot.
contour
(cube, *args, **kwargs)¶ Draws contour lines based on the given Cube.
Kwargs:
 coords: list of
Coord
objects or  coordinate names. Use the given coordinates as the axes for the plot. The order of the given coordinates indicates which axis to use for each, where the first element is the horizontal axis of the plot and the second element is the vertical axis of the plot.
 coords: list of
 axes: the
matplotlib.axes.Axes
to use for drawing.  Defaults to the current axes if none provided.
 axes: the
See
matplotlib.pyplot.contour()
for details of other valid keyword arguments.

iris.plot.
contourf
(cube, *args, **kwargs)¶ Draws filled contours based on the given Cube.
Kwargs:
 coords: list of
Coord
objects or  coordinate names. Use the given coordinates as the axes for the plot. The order of the given coordinates indicates which axis to use for each, where the first element is the horizontal axis of the plot and the second element is the vertical axis of the plot.
 coords: list of
 axes: the
matplotlib.axes.Axes
to use for drawing.  Defaults to the current axes if none provided.
 axes: the
See
matplotlib.pyplot.contourf()
for details of other valid keyword arguments.

iris.plot.
default_projection
(cube)¶ Return the primary map projection for the given cube.
Using the returned projection, one can create a cartopy map with:
import matplotlib.pyplot as plt ax = plt.ax(projection=default_projection(cube))

iris.plot.
default_projection_extent
(cube, mode=0)¶ Return the cube’s extents
(x0, x1, y0, y1)
in its default projection.Keyword arguments:
 mode  Either
iris.coords.POINT_MODE
oriris.coords.BOUND_MODE
.  Triggers whether the extent should be representative of the cell points, or the limits of the cell’s bounds. The default is iris.coords.POINT_MODE.
 mode  Either

iris.plot.
orography_at_bounds
(cube, facecolor='#888888', coords=None, axes=None)¶ Plots orography defined at cell boundaries from the given Cube.

iris.plot.
orography_at_points
(cube, facecolor='#888888', coords=None, axes=None)¶ Plots orography defined at sample points from the given Cube.

iris.plot.
outline
(cube, coords=None, color='k', linewidth=None, axes=None)¶ Draws cell outlines based on the given Cube.
Kwargs:
 coords: list of
Coord
objects or  coordinate names. Use the given coordinates as the axes for the plot. The order of the given coordinates indicates which axis to use for each, where the first element is the horizontal axis of the plot and the second element is the vertical axis of the plot.
 coords: list of
 color: None or mpl color The color of the cell outlines. If
 None, the matplotlibrc setting patch.edgecolor is used by default.
 linewidth: None or number The width of the lines showing the
 cell outlines. If None, the default width in patch.linewidth in matplotlibrc is used.
 axes: the
matplotlib.axes.Axes
to use for drawing.  Defaults to the current axes if none provided.
 axes: the

iris.plot.
pcolor
(cube, *args, **kwargs)¶ Draws a pseudocolor plot based on the given 2dimensional Cube.
The cube must have either two 1dimensional coordinates or two 2dimensional coordinates with contiguous bounds to plot the cube against.
Kwargs:
 coords: list of
Coord
objects or  coordinate names. Use the given coordinates as the axes for the plot. The order of the given coordinates indicates which axis to use for each, where the first element is the horizontal axis of the plot and the second element is the vertical axis of the plot.
 coords: list of
 axes: the
matplotlib.axes.Axes
to use for drawing.  Defaults to the current axes if none provided.
 axes: the
 contiguity_tolerance: The absolute tolerance used when checking for
 contiguity between the bounds of the cells. Defaults to None.
See
matplotlib.pyplot.pcolor()
for details of other valid keyword arguments.

iris.plot.
pcolormesh
(cube, *args, **kwargs)¶ Draws a pseudocolor plot based on the given 2dimensional Cube.
The cube must have either two 1dimensional coordinates or two 2dimensional coordinates with contiguous bounds to plot against each other.
Kwargs:
 coords: list of
Coord
objects or  coordinate names. Use the given coordinates as the axes for the plot. The order of the given coordinates indicates which axis to use for each, where the first element is the horizontal axis of the plot and the second element is the vertical axis of the plot.
 coords: list of
 axes: the
matplotlib.axes.Axes
to use for drawing.  Defaults to the current axes if none provided.
 axes: the
 contiguity_tolerance: The absolute tolerance used when checking for
 contiguity between the bounds of the cells. Defaults to None.
See
matplotlib.pyplot.pcolormesh()
for details of other valid keyword arguments.

iris.plot.
plot
(*args, **kwargs)¶ Draws a line plot based on the given cube(s) or coordinate(s).
The first one or two arguments may be cubes or coordinates to plot. Each of the following is valid:
# plot a 1d cube against its dimension coordinate plot(cube) # plot a 1d coordinate plot(coord) # plot a 1d cube against a given 1d coordinate, with the cube # values on the yaxis and the coordinate on the xaxis plot(coord, cube) # plot a 1d cube against a given 1d coordinate, with the cube # values on the xaxis and the coordinate on the yaxis plot(cube, coord) # plot two 1d coordinates against oneanother plot(coord1, coord2) # plot two 1d cubes against oneanother plot(cube1, cube2)
Kwargs:
 axes: the
matplotlib.axes.Axes
to use for drawing.  Defaults to the current axes if none provided.
 axes: the
See
matplotlib.pyplot.plot()
for details of additional valid keyword arguments.

iris.plot.
points
(cube, *args, **kwargs)¶ Draws sample point positions based on the given Cube.
Kwargs:
 coords: list of
Coord
objects or  coordinate names. Use the given coordinates as the axes for the plot. The order of the given coordinates indicates which axis to use for each, where the first element is the horizontal axis of the plot and the second element is the vertical axis of the plot.
 coords: list of
 axes: the
matplotlib.axes.Axes
to use for drawing.  Defaults to the current axes if none provided.
 axes: the
See
matplotlib.pyplot.scatter()
for details of other valid keyword arguments.

iris.plot.
quiver
(u_cube, v_cube, *args, **kwargs)¶ Draws an arrow plot from two vector component cubes.
Args:
 u_cube, v_cube : (
Cube
) u and v vector components. Must have same shape and units. If the cubes have geographic coordinates, the values are treated as true distance differentials, e.g. windspeeds, and not map coordinate vectors. The components are aligned with the North and East of the cube coordinate system.
 u_cube, v_cube : (
Kwargs:
 coords: (list of
Coord
or string)  Coordinates or coordinate names. Use the given coordinates as the axes for the plot. The order of the given coordinates indicates which axis to use for each, where the first element is the horizontal axis of the plot and the second element is the vertical axis of the plot.
 coords: (list of
 axes: the
matplotlib.axes.Axes
to use for drawing.  Defaults to the current axes if none provided.
 axes: the
See
matplotlib.pyplot.quiver()
for details of other valid keyword arguments.

iris.plot.
scatter
(x, y, *args, **kwargs)¶ Draws a scatter plot based on the given cube(s) or coordinate(s).
Args:
Kwargs:
 axes: the
matplotlib.axes.Axes
to use for drawing.  Defaults to the current axes if none provided.
 axes: the
See
matplotlib.pyplot.scatter()
for details of additional valid keyword arguments.

iris.plot.
symbols
(x, y, symbols, size, axes=None, units='inches')¶ Draws fixedsize symbols.
See
iris.symbols
for available symbols.Args:
 x: iterable
 The x coordinates where the symbols will be plotted.
 y: iterable
 The y coordinates where the symbols will be plotted.
 symbols: iterable
 The symbols (from
iris.symbols
) to plot.
 size: float
 The symbol size in units.
Kwargs:
 axes: the
matplotlib.axes.Axes
to use for drawing.  Defaults to the current axes if none provided.
 axes: the
 units: [‘inches’, ‘points’]
 The unit for the symbol size.
PlotDefn(coords, transpose)
 class
iris.plot.
PlotDefn
(_cls, coords, transpose)¶Bases:
tuple
Create new instance of PlotDefn(coords, transpose)
count
(value) → integer  return number of occurrences of value¶
index
(value[, start[, stop]]) → integer  return first index of value.¶Raises ValueError if the value is not present.
coords
¶Alias for field number 0
transpose
¶Alias for field number 1