|
|
|
|
SynopsisDraw a curve, contour, or histogram together with axis labels. Syntaxmake_figure ([id,] filename|Crate [,figuretype] [,attributes]) Description
The make_figure command creates a curve, contour, or histogram from the data provided. If an existing plot is current, it is cleared and the figure is drawn in that plot. If there is no current plot, one is created and the figure is placed in it. Choice of figure typeBy default, table data is used to create a curve and image data is used to create a contour. Specifying a figuretype overrides this behavior, e.g. to create a histogram. When creating a histogram, the two columns are used as bins and counts. Axis labelsAxis labels and units are drawn if the information is available in the input file. Plot titles are set to the value of the file keyword OBJECT or TITLE, or from the input filename (without the path and virtual filter specfications). Changing attribute valuesThe attributes option can be used to control figure characteristics. The attributes can be set to the ChIPS defaults, values provided in the make_figure command, or values from the user's preference file. Refer to the individual help files - "ahelp py.chips set_curve", "ahelp py.chips set_contour", and "ahelp py.chips set_histogram" - for information on the attributes of each object. Example 1
chips> make_figure("source.dat")If the file "source.dat" contains unix% cat source.dat # alpha beta error 1 2 0.7 4 9 2.2 9 15 3.4 then the make_figure call will plot this as a curve with symmetrical y errors, since there are three columns in the input file. As the file contains a header line, the column names are set to "alpha" and "beta". Example 2
chips> make_figure("flare.fits[cols time_bin,count_rate]")Create a curve of the time_bin and count_rate columns from the file "flare.fits". The plot title is set to the value of the OBJECT keyword in "flare.fits" (if it exists). Example 3
chips> make_figure("img.fits", "color=green thickness=2")Create contours from the file "img.fits". Set the contour color to green and the thickness to 2. If the image contains WCS information, then it will be used for the X and Y axes; in this case you may wish to change the tick label format to use sexagesimal notation by saying: chips> set_xaxis(["tickformat","ra"]) chips> reverse_axes(X_AXIS) chips> set_yaxis(["tickformat","dec"]) Example 4
chips> make_figure("peak.fits[cols energy,counts]", "histogram",
"line.style=shortdash line.color=yellow")Create a histogram from the file "peak.fits" with a short-dashed yellow line. BugsSee the bugs pages on the ChIPS website for an up-to-date listing of known bugs. |
![]() |
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. |