quantity_support¶
-
astropy.visualization.quantity_support(format='latex_inline')[source]¶ Enable support for plotting
astropy.units.Quantityinstances in matplotlib.May be (optionally) used with a
withstatement.>>> import matplotlib.pyplot as plt >>> from astropy import units as u >>> from astropy import visualization >>> with visualization.quantity_support(): ... plt.figure() ... plt.plot([1, 2, 3] * u.m) [...] ... plt.plot([101, 125, 150] * u.cm) [...] ... plt.draw()
Parameters: - format :
astropy.units.format.Baseinstance or str The name of a format or a formatter object. If not provided, defaults to
latex_inline.
- format :