astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v5.2.1 »
- Data Visualization (`astropy.visualization`) »
- time_support

# time_support

astropy.visualization.time_support(*, scale=None, format=None, simplify=True)

  Enable support for plotting `astropy.time.Time` 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.time_support():
      ...     plt.figure()
      ...     plt.plot(Time(['2016-03-22T12:30:31', '2016-03-22T12:30:38', '2016-03-22T12:34:40']))
      ...     plt.draw()

  Parameters:
    scale `python:str`, optional

      The time scale to use for the times on the axis. If not specified, the scale of the first Time object passed to Matplotlib is used.

    format `python:str`, optional

      The time format to use for the times on the axis. If not specified, the format of the first Time object passed to Matplotlib is used.

    simplify bool, optional

      If possible, simplify labels, e.g. by removing 00:00:00.000 times from ISO strings if all labels fall on that time.