Plotting Commands

XSPEC plotting is currently performed using the PLT interface. There are two basic commands: plot and iplot. The plot command makes a plot and returns the user to the XSPEC prompt, while the iplot command leaves the user in the interactive plotting interface, thus allowing the user to edit the plot. A variety of different quantities may be plotted, including the data and the current model, the integrated counts, the fit residuals, the ratio of data to model, the contributions to the fit statistic, the theoretical model, the unfolded (incident) spectrum, the detector efficiency, the results of the goodness command, and the fit-statistic contours. All data plots can have an x-axis of channels, energy, or wavelength, which are specified with setplot channel, setplot energy, setplot wave respectively. A number of different units are available for energy or wavelength. The plotting device to be used is set using setplot device or cpd. Separate spectra may be added together and channels binned up (for plotting purposes only) using setplot group (and ungrouped with setplot ungroup) and setplot rebin. There is an option to plot individual additive model components on data plots; this option is enabled by setplot add and disabled by setplot noadd. The effective area can be divided out of data plots using setplot area (which option can be turned off using setplot noarea). Line IDs can be plotted using setplot id and turned off by setplot noid. A stack of PLT commands can be created and manipulated with setplot command, setplot delete, and setplot list. This command stack then is applied to every plot.

PLT is built on top of the PGPLOT package, which comes with a standard set of device drivers. Any machine running X-windows should support /xs and /xw, while xterm windows should support /xt. PGPLOT supports monochrome and color postscript and both landscape and portrait orientation with the drivers /ps, /cps, /vps, and /vcps. The easiest way to make a hardcopy of an XSPEC plot is to use

XSPEC12> iplot
command and then at the PLT prompt to enter
PLT> hard /ps
This will make a file called which can be printed. Alternatively, the sequence
XSPEC12> cpd  <filename>/ps
XSPEC12> ... plot commands ...
XSPEC12> cpd none
will place the plots in a PostScript file <filename>.