astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v1.1.1 »
- Data Visualization (`astropy.visualization`) »
- quantity_support

# quantity_support

`astropy.visualization.``quantity_support`(format=u'latex_inline')

  Enable support for plotting `astropy.units.Quantity` instances in matplotlib.

  May be (optionally) used with a `with` statement.

      >>> 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.Base` instance or str

  > The name of a format or a formatter object. If not provided, defaults to `latex_inline`.