MplQuantityConverter#
- class astropy.visualization.MplQuantityConverter[source]#
Bases:
ConversionInterface,ContextDecoratorMatplotlib converter for
astropy.units.Quantity.Registers itself to matplotlib as the converter for
astropy.units.Quantitywhen initialized. If used as a context manager, it will restore the original converter upon exit. Also seequantity_support()for a convenient way to use this converter with an optional format for theaxisinfo.Methods Summary
__call__(func)Call self as a function.
axisinfo(unit, axis[, format])Return a
matplotlib.units.AxisInfofor unit and axis.convert(val, unit, axis)Convert obj using unit for the specified axis.
default_units(x, axis)Return the default unit for x or
Nonefor the given axis.Methods Documentation
- __call__(func)#
Call self as a function.
- static axisinfo(unit, axis, format=None)[source]#
Return a
matplotlib.units.AxisInfofor unit and axis.- Parameters:
- unit
UnitBase The unit to format the axis for.
- axis
matplotlib.axis.Axis The matplotlib axis being formatted.
- format
astropy.units.format.Basesubclass orpython:strorpython:None, optional The name of a format or a formatter class used to render the axis label. If
None, the module-level default ("latex_inline") is used.
- unit