Chandra X-Ray Observatory (CXC)
Skip to the navigation links
Last modified: 27 November 2012

How do I change the format of the axis ticklabels?


The format used to display the ticklabels is controlled by the tickformat attribute of the axis. Please see the How do I change the appearance/location of the axis ticklabels? entry for information on how to change the other properties of ticklabels.

The default setting for this attribute is '%g', which covers many cases. It supports a C-style syntax for controlling the format, so '%.2f' will force two decimal places at each label, but there are a number of plot-specific options as described in the Tick Format section of ahelp chipsopt.

The following set of commands use sexagesimal notation for the axes (examples are included in the ChIPS Image Gallery)

chips> clear()
chips> add_image("img.fits")
chips> set_xaxis(["tickformat", "%ra"])
chips> set_yaxis(["tickformat", "%dec"])

and the following creates:

[The y axis ticklabels are displayed in exponential notation and the x axis ones with one decimal point]
chips> clear()
chips> add_curve([1,2,3], [1e5, 1e6, 2e7])
chips> log_scale(Y_AXIS)
chips> set_yaxis(["tickformat", "%0.0z"])
chips> set_xaxis(["tickformat", "%.1f"])
chips> set_axis(["*.size", 18])

The ChIPS GUI

The ChIPS GUI makes it easy to modify a visualization using your mouse, rather than Pythoon functions. New in CIAO 4.5 is the ability to add annotations - such as labels, lines, points and regions - directly from the GUI.



Last modified: 27 November 2012
CXC logo

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