Emagram#

class metpy.plots.Emagram(fig=None, subplot=None, rect=None, aspect='auto')[source]#

Make Emagram plots of data.

Emagram plots are T log-P thermodynamic diagrams. They differ from SkewT in that the T axis is not skewed. This class is derived from the SkewT class and has the same capabilities for plotting data, wind barbs, dry and saturated adiabats, and mixing ratio lines.

ax#

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

Type:

matplotlib.axes.Axes

Create Emagram plots.

Parameters:

Methods Summary

__init__([fig, subplot, rect, aspect])

Create Emagram plots.

plot(pressure, t, *args, **kwargs)

Plot data.

plot_barbs(pressure, u, v[, c, xloc, ...])

Plot wind barbs.

plot_dry_adiabats([t0, pressure])

Plot dry adiabats.

plot_mixing_lines([mixing_ratio, pressure])

Plot lines of constant mixing ratio.

plot_moist_adiabats([t0, pressure])

Plot moist adiabats.

shade_area(y, x1[, x2, which])

Shade area between two curves.

shade_cape(pressure, t, t_parcel, **kwargs)

Shade areas of Convective Available Potential Energy (CAPE).

shade_cin(pressure, t, t_parcel[, dewpoint])

Shade areas of Convective INhibition (CIN).

Methods Documentation

__init__(fig=None, subplot=None, rect=None, aspect='auto')[source]#

Create Emagram plots.

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

Plot data.

Simple wrapper around plot so that pressure is the first (independent) input. This is essentially a wrapper around plot.

Parameters:
  • pressure (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 plot()

  • kwargs – Other keyword arguments to pass to plot()

Returns:

list[matplotlib.lines.Line2D] – lines plotted

plot_barbs(pressure, 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:
  • pressure (array-like) – pressure values

  • u (array-like) – U (East-West) component of wind

  • v (array-like) – V (North-South) component of wind

  • c (array-like, optional) – 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, pressure=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.

  • pressure (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(mixing_ratio=None, pressure=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:
  • mixing_ratio (array-like, optional) – Unitless mixing ratio values to plot. If none are given, default values are used.

  • pressure (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, pressure=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.

  • pressure (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 (str) – 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

shade_cape(pressure, t, t_parcel, **kwargs)[source]#

Shade areas of Convective Available Potential Energy (CAPE).

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

Parameters:
  • pressure (array-like) – Pressure values

  • t (array-like) – Temperature values

  • t_parcel (array-like) – Parcel path temperature values

  • limit_shading (bool) – Eliminate shading below the LCL or above the EL, default is True

  • kwargs – Other keyword arguments to pass to matplotlib.collections.PolyCollection

Returns:

matplotlib.collections.PolyCollection

shade_cin(pressure, t, t_parcel, dewpoint=None, **kwargs)[source]#

Shade areas of Convective INhibition (CIN).

Shades areas where the parcel is cooler than the environment (areas of negative buoyancy). If dewpoint is passed in, negative area below the lifting condensation level or above the equilibrium level is not shaded.

Parameters:
  • pressure (array-like) – Pressure values

  • t (array-like) – Temperature values

  • t_parcel (array-like) – Parcel path temperature values

  • dewpoint (array-like) – Dew point values, optional

  • kwargs – Other keyword arguments to pass to matplotlib.collections.PolyCollection

Returns:

matplotlib.collections.PolyCollection