PintConverter

class metpy.units.PintConverter(registry)[source]

Implement support for pint within matplotlib’s unit conversion framework.

Initialize converter for pint units.

Methods Summary

__init__(registry) Initialize converter for pint units.
axisinfo(unit, axis) Return axis information for this particular unit.
convert(value, unit, axis) Convert :Quantity instances for matplotlib to use.
default_units(x, axis) Get the default unit to use for the given combination of unit and axis.
is_numlike(x) The Matplotlib datalim, autoscaling, locators etc work with scalars which are the units converted to floats given the current unit.

Methods Documentation

__init__(registry)[source]

Initialize converter for pint units.

static axisinfo(unit, axis)[source]

Return axis information for this particular unit.

convert(value, unit, axis)[source]

Convert :Quantity instances for matplotlib to use.

static default_units(x, axis)[source]

Get the default unit to use for the given combination of unit and axis.

static is_numlike(x)

The Matplotlib datalim, autoscaling, locators etc work with scalars which are the units converted to floats given the current unit. The converter may be passed these floats, or arrays of them, even when units are set.