Chandra X-Ray Observatory
Skip to the navigation links
Last modified: 13 April 2018

How do I add or change axis labels?

The set_plot_xlabel and set_plot_ylabel routines can add, remove, or change the axis labels:

chips> set_plot_xlabel(r"Wavelength (\AA)")
chips> set_plot_ylabel("Count rate (s^{-1})")

For labels which contain a \ character it is safest to precede the string with a r, as shown in the x-label line above. An alternative is to use \\ instead of \.

To remove a label use an empty string - e.g. set_plot_ylabel("").

More information on these commands can be found using ahelp set_plot.

If you have the CIAO scripts package installed (available from the Scripts page) then you can also use the xlabel and ylabel routines from the chips_contrib.utils module:

chips> from chips_contrib.utils import *
chips> xlabel("Energy (keV)")
chips> ylabel("Counts")


The ChIPS GUI makes it easy to modify a visualization using your mouse, rather than Python functions. The GUI can also be used to add annotations - such as labels, lines, points and regions - and to zoom or pan into plots.

Last modified: 13 April 2018
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email: Smithsonian Institution, Copyright © 1998-2017. All rights reserved.