SkewT

class metpy.plots.SkewT(fig=None, rotation=30, subplot=(1, 1, 1))[source]

Make Skew-T log-P plots of data.

This class simplifies the process of creating Skew-T log-P plots in using matplotlib. It handles requesting the appropriate skewed projection, and provides simplified wrappers to make it easy to plot data, add wind barbs, and add other lines to the plots (e.g. dry adiabats)

ax

The underlying Axes instance, which can be used for calling additional plot functions (e.g. axvline)

Type:matplotlib.axes.Axes

Create SkewT - logP plots.

Parameters:

Methods Summary

__init__([fig, rotation, subplot]) Create SkewT - logP plots.
plot(p, t, *args, **kwargs) Plot data.
plot_barbs(p, u, v[, c, xloc, …]) Plot wind barbs.
plot_dry_adiabats([t0, p]) Plot dry adiabats.
plot_mixing_lines([w, p]) Plot lines of constant mixing ratio.
plot_moist_adiabats([t0, p]) Plot moist adiabats.
shade_area(y, x1[, x2, which]) Shade area between two curves.
shade_cape(p, t, t_parcel, **kwargs) Shade areas of CAPE.
shade_cin(p, t, t_parcel, **kwargs) Shade areas of CIN.

Methods Documentation

__init__(fig=None, rotation=30, subplot=(1, 1, 1))[source]

Create SkewT - logP plots.

Parameters:
plot(p, t, *args, **kwargs)[source]

Plot data.

Simple wrapper around plot so that pressure is the first (independent) input. This is essentially a wrapper around semilogy. It also sets some appropriate ticking and plot ranges.

Parameters:
  • p (array_like) – pressure values
  • t (array_like) – temperature values, can also be used for things like dew point
  • args – Other positional arguments to pass to semilogy()
  • kwargs – Other keyword arguments to pass to semilogy()
Returns:

list[matplotlib.lines.Line2D] – lines plotted

plot_barbs(p, u, v, c=None, xloc=1.0, x_clip_radius=0.1, y_clip_radius=0.08, **kwargs)[source]

Plot wind barbs.

Adds wind barbs to the skew-T plot. This is a wrapper around the barbs command that adds to appropriate transform to place the barbs in a vertical line, located as a function of pressure.

Parameters:
  • p (array_like) – pressure values
  • u (array_like) – U (East-West) component of wind
  • v (array_like) – V (North-South) component of wind
  • c – An optional array used to map colors to the barbs
  • xloc (float, optional) – Position for the barbs, in normalized axes coordinates, where 0.0 denotes far left and 1.0 denotes far right. Defaults to far right.
  • x_clip_radius (float, optional) – Space, in normalized axes coordinates, to leave before clipping wind barbs in the x-direction. Defaults to 0.1.
  • y_clip_radius (float, optional) – Space, in normalized axes coordinates, to leave above/below plot before clipping wind barbs in the y-direction. Defaults to 0.08.
  • plot_units (pint.unit) – Units to plot in (performing conversion if necessary). Defaults to given units.
  • kwargs – Other keyword arguments to pass to barbs()
Returns:

matplotlib.quiver.Barbs – instance created

plot_dry_adiabats(t0=None, p=None, **kwargs)[source]

Plot dry adiabats.

Adds dry adiabats (lines of constant potential temperature) to the plot. The default style of these lines is dashed red lines with an alpha value of 0.5. These can be overridden using keyword arguments.

Parameters:
  • t0 (array_like, optional) – Starting temperature values in Kelvin. If none are given, they will be generated using the current temperature range at the bottom of the plot.
  • p (array_like, optional) – Pressure values to be included in the dry adiabats. If not specified, they will be linearly distributed across the current plotted pressure range.
  • kwargs – Other keyword arguments to pass to matplotlib.collections.LineCollection
Returns:

matplotlib.collections.LineCollection – instance created

plot_mixing_lines(w=None, p=None, **kwargs)[source]

Plot lines of constant mixing ratio.

Adds lines of constant mixing ratio (isohumes) to the plot. The default style of these lines is dashed green lines with an alpha value of 0.8. These can be overridden using keyword arguments.

Parameters:
  • w (array_like, optional) – Unitless mixing ratio values to plot. If none are given, default values are used.
  • p (array_like, optional) – Pressure values to be included in the isohumes. If not specified, they will be linearly distributed across the current plotted pressure range up to 600 mb.
  • kwargs – Other keyword arguments to pass to matplotlib.collections.LineCollection
Returns:

matplotlib.collections.LineCollection – instance created

plot_moist_adiabats(t0=None, p=None, **kwargs)[source]

Plot moist adiabats.

Adds saturated pseudo-adiabats (lines of constant equivalent potential temperature) to the plot. The default style of these lines is dashed blue lines with an alpha value of 0.5. These can be overridden using keyword arguments.

Parameters:
  • t0 (array_like, optional) – Starting temperature values in Kelvin. If none are given, they will be generated using the current temperature range at the bottom of the plot.
  • p (array_like, optional) – Pressure values to be included in the moist adiabats. If not specified, they will be linearly distributed across the current plotted pressure range.
  • kwargs – Other keyword arguments to pass to matplotlib.collections.LineCollection
Returns:

matplotlib.collections.LineCollection – instance created

shade_area(y, x1, x2=0, which='both', **kwargs)[source]

Shade area between two curves.

Shades areas between curves. Area can be where one is greater or less than the other or all areas shaded.

Parameters:
  • y (array_like) – 1-dimensional array of numeric y-values
  • x1 (array_like) – 1-dimensional array of numeric x-values
  • x2 (array_like) – 1-dimensional array of numeric x-values
  • which (string) – Specifies if positive, negative, or both areas are being shaded. Will be overridden by where.
  • kwargs – Other keyword arguments to pass to matplotlib.collections.PolyCollection
Returns:

matplotlib.collections.PolyCollection

See also

matplotlib.collections.PolyCollection, matplotlib.axes.Axes.fill_betweenx()

shade_cape(p, t, t_parcel, **kwargs)[source]

Shade areas of CAPE.

Shades areas where the parcel is warmer than the environment (areas of positive buoyancy.

Parameters:
  • p (array_like) – Pressure values
  • t (array_like) – Temperature values
  • t_parcel (array_like) – Parcel path temperature values
  • kwargs – Other keyword arguments to pass to matplotlib.collections.PolyCollection
Returns:

matplotlib.collections.PolyCollection

See also

matplotlib.collections.PolyCollection, matplotlib.axes.Axes.fill_betweenx()

shade_cin(p, t, t_parcel, **kwargs)[source]

Shade areas of CIN.

Shades areas where the parcel is cooler than the environment (areas of negative buoyancy.

Parameters:
  • p (array_like) – Pressure values
  • t (array_like) – Temperature values
  • t_parcel (array_like) – Parcel path temperature values
  • kwargs – Other keyword arguments to pass to matplotlib.collections.PolyCollection
Returns:

matplotlib.collections.PolyCollection

See also

matplotlib.collections.PolyCollection, matplotlib.axes.Axes.fill_betweenx()