Loving ISIS - Confessions of a Former XSPEC User | ||
|
Plotting:
ISIS plotting, like XSPEC plotting, is ultimately based upon
PGPLOT. (On the
other hand, any plotting package wrapped in ISIS provides a number of intrinsic plotting functions based upon the PGPLOT library. A partial list of some of the most basic plotting commands are:
xlabel("string"); ylabel("string"); % X/Y Plot Labels
id = open_plot("device"); close_plot(id); % Open and close PGPLOT devices
xrange(#,#); yrange(#,#); % Set plot X/Y ranges
charsize(#); point_size(#); % Character/symbol sizes
plot(x,y); % Line/scatter plots
oplot(x,y); % Line/scatter overplots
hplot(xlo,xhi,y); % Histogram plots
ohplot(xlo,xhi,y); % Histogram overplots
plot_unit("unit"); % Toggle between A, keV, etc.
plot_data_counts(id); % Plot counts/bin
rplot_counts(id); % Plot counts, model, and residuals
These will get you a decent amount of functionality. One advantage
that they do have over their XSPEC counterparts is that there is
no difference between default plotting and interactive plotting.
I.e., you do not have to 'drop down' into an IPLOT mode, perform your
interactive plotting commands, then 'pop back up' into data analysis
mode. It's all one and the same in ISIS. (You're always
in analysis mode, and you're always interactive, unless, of course, you
are running a script.)
My desire, however, for better plotting in ISIS, led me to put a
number of wrappers around ISIS plotting commands. (This, in fact,
represents the bulk of my Plot_Unit(); - Toggle among eV->TeV, A->m, and Hz->GHz
plot_bsub_counts(); - Plot background subtracted data as counts/bin
plot_bsub_all(); - Plot background subtracted data as counts/sec/Plot_Unit
plot_bsub_model(); - Plot of just the background subtracted model
oplot_bsub_model(); - Overplot the background subtracted model
plot_residuals(); - Plot just the data residuals
plot_unfold(); - Plot the unfolded spectra
pg_color(); - Make a nice green, brown, pink, and dark gold for plots
open_print(); - Open a plot device, invoking pg_color first
close_print(); - Close the plot device, and optionally invoke gv or the like to view it
diskbb model, and you'll see what I
mean...).
All of my plotting functions can be run in several ways. All take
arrays of dataset indices, with plot preferences omitted (sensible
defaults will used). If choosing plot preferences (e.g., data
symbol, residual type, etc.), they can be input as an ordered list
(not recommended - only there for backwards compatibility to very
early versions of my scripts), input as pairs of keywords and values,
or input as a structure variable, with structure field names
corresponding to keywords and structure field values corresponding to
the associated plot choices. All values/choices refer to PGPLOT color
and symbol choices, e.g., 4 is blue when a color or a circle when a
symbol. See the analysis script for
examples of using both keyword/value pairs and structure variable
setting of plot preferences. You can also use my defined function
Here are a few examples of plots that you won't normally see coming
out of XSPEC. On the left is the broken power law/reflection
model/diskline fit (yes, unfolded spectra, sorry) showing the
radio/PCA/HEXTE data vs. frequency, while the right is the same model
showing the RXTE detector space data vs. Angstroms. (The latter can be
done in XSPEC. The former would take a little work.) Again, the
same commands to create them interactively were the same commands used
to create the hardcopies (via the ISIS intrinsic commands:
Next up: A quick summary. |
This page was last updated Mar 22, 2006 by Michael Nowak. To comment on it or the material presented here, send email to mnowak@space.mit.edu.
![]()