|AHELP for CIAO 4.5 ChIPS v1||
Create a basic plot of a curve, contour, image, or histogram (includes axis labels and a plot title).
make_figure ([id,] filename|Crate [,figuretype] [,attributes])
- id - an optional ChipsId structure containing values to modify the currency state for the command or a string id to modify a label within the current frame.
- filename or crate - input data, specified as a filename (which can include the DM virtual-file syntax such as column specifiers) or a Crate object (e.g. as returned by the read_file command).
- figuretype - a string identifying the type of figure to create: "curve", "contour", "image", or "histogram". If omitted, the figuretype is determined from the input data.
- attributes - optional parameters which allow the user to configure properties though a structure, list, or attribute string.
The make_figure command creates a curve, contour, image, 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.
By 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 an image or a histogram. When creating a histogram, the two columns are used as the bin center and the counts.
Axis 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).
The 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 set_curve", "ahelp set_contour", "ahelp set_image", and "ahelp set_histogram" - for information on the attributes of each object.
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 axis labels are set to "alpha" and "beta".
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).
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> set_yaxis(["tickformat","dec"])
chips> make_figure("img.fits", "image", "colormap=hsv") chips> set_xaxis(["tickformat","ra"]) chips> set_yaxis(["tickformat","dec"]) chips> add_colorbar(1.05, 0.5, ["orientation", "vertical"])
Display the contents of img.fits as an image, using the hsv colormap to color the pixels. A vertical colorbar is added to the right of the image.
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.
chips> cr = read_file("flare.fits[cols time_bin,count_rate]") chips> make_figure(cr)
Read the columns time_bin and count_rate into the crate (cr) using the Crates' read_file() command, and then use this to create a plot of the data. In this case, since the data is tabular then the data will be plotted as a curve.
chips> cr = read_file("img.fits") chips> make_figure(cr, "image", "colormap=hsv") chips> set_xaxis(["tickformat","ra"]) chips> set_yaxis(["tickformat","dec"]) chips> add_colorbar(1.05, 0.5, ["orientation", "vertical"])
Here we read the image "img.fits" via the Crates read_file command, and send the return value (a crate) to make_figure.
See the bugs pages on the ChIPS website for an up-to-date listing of known bugs.