About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: 20 May 2008
Hardcopy (PDF): A4 | Letter

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


The make_figure() (S-Lang, Python help) 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.

# Python
  make_figure("img.fits")
  make_figure("img.fits", [10,20,30])
  make_figure("img.fits", [10,20,30], ["wcs","physical","line.color","red"])
% S-Lang
  make_figure("img.fits");
  make_figure("img.fits", [10,20,30]);
  make_figure("img.fits", [10,20,30], {"wcs","physical","line.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).

More examples can be seen in the ChIPS Gallery (S-Lang and Python versions).



Hardcopy (PDF): A4 | Letter
Last modified: 20 May 2008


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-2004. All rights reserved.