yt.visualization.plot_window.PlotWindow.set_axes_unit — The yt Project 3.2-dev documentation

# yt.visualization.plot_window.PlotWindow.set_axes_unit

`PlotWindow.` `set_axes_unit`(*args, **kwargs)

  Set the unit for display on the x and y axes of the image.

  Parameters: | unit_name : string or two element tuple of strings A unit, available for conversion in the dataset, that the image extents will be displayed in. If set to None, any previous units will be reset. If the unit is None, the default is chosen. If unit_name is ‘1’, ‘u’, or ‘unitary’, it will not display the units, and only show the axes name. If unit_name is a tuple, the first element is assumed to be the unit for the x axis and the second element the unit for the y axis.
  Raises: | YTUnitNotRecognized : If the unit is not known, this will be raised.

  Examples

      >>> from yt import load
      >>> ds = load("IsolatedGalaxy/galaxy0030/galaxy0030")
      >>> p = ProjectionPlot(ds, "y", "Density")
      >>> p.set_axes_unit("kpc")