Chandra X-Ray Observatory
Skip to the navigation links
Last modified: 26 October 2016


CIAO 3 to CIAO 4: General differences

Changes in objects and concepts

Language support

The command language is no-longer supported in CIAO 4. Instead there is a Python module which can be used within scripts or in an interactive environment. The chips command will now start up an interactive Python environment as discussed in the Starting ChIPS thread.

Double precision

ChIPS now works with double-precision floating point numbers, rather than single-precision ones as in CIAO 3.4. The figures below show one example of the difference this can make:

[Single precision in CIAO 3.4] [Double precision in CIAO 4]

Output formats

Visualizations can now be output in postscript, encapsulated postscript, PDF, PNG, or JPEG formats. The postscript formats can be written out in RGB, CMYK, or greyscale color schemes.

Support for images and colorbars

ChIPS in CIAO 4 supports plotting images and colorbars, including "true-color" and partially-transparent images. Examples are available in the ChIPS image gallery.

Histograms are now distinct from curves

If a CURVE is drawn using the STEP connector style then it should now be created as a histogram rather than a curve. It is no longer possible to change between STEP and SIMPLELINE styles once a dataset has been plotted (it remains drawn as a curve or a histogram).

Several simple histogram examples are available in the ChIPS histogram gallery and there is also a histogram thread describing the capabilities of histograms in CIAO 4.

Multiple contours in a plot

It is now possible to have multiple contours (as well as other objects such as curves, images and histograms) in the same plot.

Contours can now be drawn for FITS images, and labelled using their WCS information. They can also be overlaid on images.

A new name for drawarea

The name for "drawarea" - also known as "pane" - is now "plot".

The naming of curves, lines, and labels

In the old command language, items were referenced by number, so you said

C 2 red

to change to the second curve and then make it's line color be red. Each object (such as plot, curve, line, and label) now uses a string as an identifier and the default is to have values like "crv1", "crv2", ... "crvn", although any string can be used if desired. The above command would be translated to one of:

chips> current_curve("crv2")
chips> set_curve(["line.color", "red"])


chips> set_curve("crv2", ["line.color", "red"])

Refering to multiple objects with a single command

In the old command language you could refer to a single object, a subset of objects - either as n:m or a list a,b,..,x - or all objects. It is no longer possible to refer to a subset of objects.

Improved control over the appearance of your visualization

There are many more ways to change the appearance of your plots, in particular for axes. The "Axis styles and grids" section of the ChIPS gallery contain a range of examples of the changes that can be made.

ChIPS also provides a GUI for modifying your visualization directly, including the ability to add annotations - such as lines, labels, points, regions and color bars - directly from the GUI.

Multiple axes in a plot

Plots can now contain more than two axes. These can be copies of one of the existing axis - e.g. at y=0 in a residual-style plot - or can create a completely new coordinate system - e.g. in strip-style plots where you want to display multiple quantities, such as RA and temperature, against a common axis (time, say). A number of examples are available in the ChIPS gallery - in particular an example showing how to use text rather than numbers along an axis as well as in a number of the threads, such as this example.

Changing the order that items are displayed

It is now possible to change the order that objects are drawn, to make sure that certain objects appear above - or below - other items. The Depth control page describes this capability in more detail. An example is shown in this temperature versus redshift plot.

Improvements and changes to lines

  • There is now an easy way to create a horizontal or vertical line which always extends to the edges of the plot: the add_hline() and add_vline() routines.
  • If a line is drawn from (x1,y1) to (x2,y2) then it can be extended at either, or both, ends. so that it always reaches the edge of the plot.
  • Lines can now connect more that two points.

Polygon support (regions)

CIAO 4 introduces regions as a new object. These allow you to draw regular polygons - by specifying the center position, radius, and number of sides - or genreal polygons by specifying the coordinates of the vertices. If the polygon is convex - so it does not intersect - then its interior can be filled with a color or pattern.

Examples are available in the ChIPS annotations gallery.

Multiple windows and frames

It is now possible to create plots in different windows, and switch back and forth between them. Plots are created within a frame; plot and frame positions can be changed which provides great control over the layout of your visualization. The threads - in particular the Creating and using multiple plots thread - show examples of this flexibility; another example is this figure.

Colors and Opacity

The handling of colors has changed significantly. Many more colors can be given by name, with the names taken from the rgb.txt file from the X11 distribution (often found at /usr/lib/X11/rgb.txt). They can also be given as a 6-digit hexadecimal number, in string format, where the first two digits refer to the red channel, the middle two as the green channel, and the last two as the blue channel. The numeric form of this hexadecimal number can also be used.

The following all set the label color to red

chips> set_label(["color", "red"])
chips> set_label(["color", "ff0000"])
chips> set_label(["color", 0xff0000])

The value "default" can also be used, which means that the color is taken from the foreground.display or foreground.file preference setting for screen and hardcopy outputs. This value can also be used for bgcolor attributes, where the background.display and background.file preference settings are used instead. With the default settings, the on-screen display is drawn in white on a black background that is automatically transformed into black on a white background when printed to a hardcopy format.

The color ahelp page contains more details.

The opacity of filled regions and histograms can also be changed; for example the Using a filled region (solid) to show the error bounds gallery example.

Images can have their alpha channel changed to allow overlapping images, as shown in the alpha channel can be used to blend together multiple images gallery example.

Line styles

The name of some of the line styles has changed:

solid solid
dot dot
dash shortdash
longdash longdash
dotdash dotshortdash
dotlongdash dotlongdash
dashlongdash shortdashlongdash

Using "noline" or "none" will stop the line from being drawn.

See the Line Style documentation for more information.

Symbol styles

ChIPS now separates out the symbol shape from whether it is filled or not, using the style and fill flags. The mapping between the old style names and the new ones is shown below, where the fill column is given if the value is meaningful. The default fill value is True, so it will only need to be changed to get open/hollow shapes.

ChIPS 3 ChIPS 4 Fill value
none none
bigpoint circle True
block square True
circle circle False
cross cross True
diamond diamond False
downtri downtriangle False
point point
smallpoint point
square square False
uptri uptriangle False
soliddiamond diamond True
soliddowntri downtriangle True
soliduptri uptriangle True

New symbol styles are plus and arrow. It is also possible to rotate symbols by changing the angle attribute value.

See the Symbol Style documentation for more information.


Most Items now have a thickness attribute that determines how wide the line used to draw them is. It takes a value between 0.5 and 10.0, with the differences between values - such as 0.5 and 1.0 - only visible in the vector output formats, such as postscript and PDF.

See the Thickness documentation for more information.

Symbol and Font sizes

The size argument for symbols and fonts do not have the same scale as in the old ChIPS language. For instance, font sizes are now given in points.

Text appearance and special symbols

There are more attributes that can be changed to control the position and appearance of labels. For instance the font type, font style, angle, and position can be changed. The position of the reference location within a label can be changed, which allows you to center- or right-justify text. There can now be multiple fonts within the same plot.

If the text contains LaTeX commands beginning with a \ character then either use the r modifier to avoid the backslash symbol being parsed by Python, or preceed the backslash with another backslash. So, to set the Y-axis label to "y = \alpha_i^2", you would say one of:

chips> set_plot_ylabel(r"y = \alpha_i^2")
chips> set_plot_ylabel("y = \\alpha_i^2")

See the Text formatting documentation for more information.

Last modified: 26 October 2016
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.