Last modified: 12 December 2018

How do I quickly create a contour plot of an image?

The make_figure routine can be used to contour an image. If the image contains WCS information then the contours will be drawn using this grid, unless specified otherwise.

[Contour plot of an image]
make_figure("img.fits", [10,20,30])
make_figure("img.fits", ["levels", [10,20,30], "mode", "arbitrary", "wcs","physical","color","red"])

In the first example the contours will be drawn equally spaced between the minumum and maximum pixel values. In the other cases the levels will be drawn at 10, 20, and 30. In the last example the line color has been changed to red - as discussed in the Attribute Concept documentaion - and the axes drawn using the physical coordinate system (SKY for Chandra images).


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.

The ChIPS Gallery

More examples can be seen in the ChIPS Gallery.

Unsupported WCS projections

The add_contour, add_image, and make_figure commands will warn you if given an image with an unsupported WCS projection (that is, everything but a tangent-plane projection), and fall back to using the physical or logical systems. An example of the warning is:

chips WARNING: Unable to use world transform - RA---SIN, DEC--SIN is an unsupported type. Using physical transform.