1 XPLOT 2.0 commands
XPLOT is an interactive plotting program which directly uses the history 
files created by XSPEC. The command handling is done in the same 
way as in XSPEC. Plotting in XSPEC is only possible for the data sets 
currently in use. Using history files one can store more data sets and 
fit results. XPLOT is designed to plot these. It allows the user to 
draw e.g. several spectra with different models in one plot or to plot for a 
large set of spectra (e.g. a time sequence) the results of spectral fits. 
Fit parameters can be plotted versus time or versus each other. Contour plots 
can be made using the output of the XSPEC steppar command. 

2 Summary_of_commands
XPLOT consists mainly of a set of commands to read information from the 
history file (like data, history, rdcont, rdfit, rdmod and spectrum), 
commands to work interactively on the data to plot (like add, divide, 
fold, linear and logarith) and commands for the plot layout (like font, 
label, plot, setplot and viewport). The `read' commands only read 
in the information and the plot command can then be used to plot it. 
Several `read' commands can be used before the data is plotted with 
the plot command. All the commands to make changes on the current plot 
do not update the plot. This allows you to make several changes before you 
update the graph with the plot command.

	add	  - Add two data sets or a constant to a data set. 
	average	  - Evaluate average in certain x-interval
	chatter   - Control the verbosity of XPLOT. 
	clear	  - Clear current data buffers and reset plot environment.
        cpd       - Alias for "setplot device".

	data	  - Read next 'data' package in history file.
	divide	  - Divide two data sets.
	exit	  - Wind up any hardcopy plots and exit from XSPEC to system.
	fold	  - Fold data on x - axis.
	font	  - Change character font.

        hardcopy - Make a hardcopy plot and spool to the printer.
	help	  - Get help on the available XPLOT commands.
	helpxspec - Get help on the available XSPEC commands.
	history	  - Open a history file, in order to read XSPEC results.
        iplot     - As plot command but interactive using PLT.

	kev_ang	  - Convert keV into Angstrom (for spectra).
	label	  - Write labels.
	linear	  - Linear plot.
	logarith  - Logarithmic plot.
	mark	  - Place a marker on plot.

	model	  - Plot model in spectrum package or not
	multiply  - Multiply two data sets or a constant to a data set. 
	newset    - Rearrange x and y from previous data sets.
	norm	  - Normalize data set by aver. value in certain x-interval.
	pause	  - Exit the program with a 'pause' statement.

	plcont	  - Plot chi-square contours.
	plot	  - Plot current data set(s) on the current plot device.
	rdcont	  - Read steppar package for chi-square contouring.
	rdfit	  - Read fit packages from history file.
	rdmod     - Read model spectrum (photons/cm**2 s keV).

	rdqdp     - Read data from file in QDP format.
	reexecute - Reexecute previous commands.
	rescale	  - Reset lower and upper limits on the plot.
	residuals - Plot residuals.
	setplot   - Modify the plot device and environment.

        show      - Give information on current data sets.
	spectrum  - Read next 'spectrum' package in history file.
	symbol	  - Change plot symbol.
	unfoldspec- 'Unfold' spectrum using folded PHA and model
		    spectrum and the model spectrum before folding.
	viewport  - Change size of viewports.
	wrqdp	  - Write data sets in QDP format (tables)
 
2 Description_syntax
   XPLOT uses the same command handling routines as XSPEC. Therefore any 
exceptional response to the command prompt and the command description 
syntax used in the following subsections is the same as for XSPEC. 
Typing a `?' or anything else results in a list of the commands 
available. 
   XPLOT allows the user to divide the total plotting area on the currently 
defined device into parts (up to 3 in horizontal and 5 in vertical direction). 
In the following description these are  called `viewports'. Vectors 
which contain the x and y data created by `read' commands or by commands 
which work on existing data are called `data sets'. These are numbered 
through as they are created in XPLOT. 
   The individual commands are treated in the following sections, in
alphabetical order. The write-up for each command includes a brief description
of the purpose, a syntax outline, a more detailed discussion of the command
assumptions and purpose, and a series of examples.  Some commands have one or
more subcommands which will be similarly described following the command.
   In the command description, the syntax uses the following conventions:
	    <an argument>		- an argument to the command
	    <compound argument> =::	  <argument a> <argument b>
					- the definition of a compound argument
	    <an argument>...		- a repeated string of arguments of
					  the same type
	    [<an argument>]		- an optional argument
	    { <arg a> OR <arg b> } 	- a choice between an argument of type
					  <arg a> or <arg b> must be made.
2 An_example
  xplot> history filnam		! Open history file for data input
  xplot> setplot device /te	! Plot on terminal in tektronix mode	
  xplot> setpl divi 1 3		! Divides screen into 3 viewports in
                                  vertical direction.
  xplot> data			! Read first 'data file' package in history
                                  file. The names of the data files will
                                  be written to the terminal for info.
  xplot> spectrum		! Read first 'spectrum' package after the
                                  'data file' package.
  xplot> plot 1 3		! Plot spectrum in upper viewport.
  xplot> data 20		! Skip 19 'data file' packages and go to no 20.
  xplot> spectrum
  xplot> plot 1 2		! Plot into middle viewport.
  xplot> data
  xplot> spectrum
  xplot> plot 1 1		! Plot into lower viewport.
  xplot> label t "This is ..."	! Write label on top of the 3 viewports.
  xplot> label y3 " "		! Switch off y label on upper viewport.
  xplot> label y1 " "		! Switch off y label on lower viewport.
  xplot> log x			! Logarithmic energy scale.
  xplot> log y3			! Logarithmic y scale only on upper viewport.
  xplot> plot                   ! Update the plot.
  xplot> setplot dev file.ps/ps ! Open postscript file.
  xplot> font roman		! Nicer characters.
  xplot> plot			! Plot 'into' file.
  xplot> setpl dev /te
  xplot> $ pslaser file		! Laser file.ps
  xplot> history filnam2
  xplot> clear			! New start for a new plot.
  xplot> setpl divi 1 2		! Divides screen into 2 viewports in
                                  vertical direction.
  xplot> rdfit day 1985 1       ! Read time from PHA files and parameter 1 
                                  from all fit packages in history file. 
  xplot> rdfit day 1985 3       ! Read time and parameter 3 from all fit 
                                  packages in history file. 
  xplot> plot 1 1 1 2           ! Plot data set 1 (fit parameter 1) into 
                                  lower viewport (1 1) and data set 2 (fit 
                                  parameter 3) into upper (1 2) viewport 
                                  vs time in units of day in year 1985.
  ...
2 $
	$ [<command line>]
	Execute an operating system command.
3 syntax
	$ [<command line>]
where <command line> is any single line containing an operating system command.
Details of this are, of course, implementation dependent, the following notes
applying to VAX VMS systems.
	The parsing of the <command line> is NOT done using the XPLOT parser,
therefore /s, \s, skipped fields, double quotes etc. all have the meaning they
would in an operating system command.  In particular, the continuation
character, '-', is not recognized by XPLOT.  In the current implementation
<command line> can contain at most 80 characters.
	The VMS command processor is set up in a spawned sub-process.  If
<command line> is non-blank, the sub-process will evaluate it as a single VMS
command, after which control automatically returns to XPLOT.  If <command line>
is empty, the sub-process will attach its input stream to the terminal,
allowing multiple commands to be input.  The VMS 'logout' (or 'lo') command is
used to terminate the sub-process and return to XPLOT.
	Any VMS command can be run under the sub-process, including linking and
running other jobs, even to fire up another copy of XPLOT.  However, it is
important to realize that changes to the process table are confined to the
sub-process and do not effect the process running XPLOT.  In particular, any
changes to the default directory (using the VMS 'set def' command) will NOT
modify the default directory used by XPLOT in opening and closing files.
(However, see the 'pause' command below.).
3 examples
  The initial 'XPLOT> ' is the prompt of the XPLOT command parser, while
  the initial '$ ' is the prompt of the VMS command language handler.
  xplot> $ dir			! Execute the operating system command 'dir'
				    (under VMS, to list the current directory).
  xplot> $ talk xyz A message	! Execute the 'talk xyz A message'
  xplot> $			! Be able to execute several commands
  $ set def [common.abc]	! In VMS, change the SUB-process default
				    directory to [common.abc]
  $ meobs			! Execute the 'meobs' command.
  ...				! Do some VMS commands
  $ lo				! Return to XPLOT
  xplot> $ show user		! List the current users.
2 add
	add <data set 1> {<data set 2> or 
                               constant <constant>[<clow>][<chigh>}
Add the y-values of <data set 1> and <data set 2> or a constant. 
The constant can be followed by lower and upper limits for calculating 
errors. Both data sets must have the same number of data points and 
should have the same x-values. 
3 examples
 XPLOT> rdfit jdate 1    ! Read fit parameter 1.
 XPLOT> rdfit jdate 4    ! Read fit parameter 4.
 XPLOT> plot             ! Plot parameter 1 and 4 vs time.
 XPLOT> add 1 2          ! Add fit parameter 1 (data set 1) and 
                           parameter 4 (data set 2).
 XPLOT> plot             ! Plot sum of parameters vs time.
 ...
 XPLOT> rdfit jdate 1               ! Read fit parameter 1.
 XPLOT> plot                        ! Plot vs time.
 XPLOT> add 1 constant 2. 1.95 2.05 ! Add 2.0 to fit parameter 1.
                                      Errors of fit parameter 1 and of
                                      2.0+-0.05 are added quadratically.
2 average
	average <xmin> <xmax> <data set 1,2,...>
	Evaluate average value between xmin and xmax for data set 1,2...
3 examples
Assume you have read in and plotted fit parameter 2 (data set 1) of a
certain set of fitted spectra versus time (in days of 1985).
  xplot> average 20.1 20.5	! Average data set no 1 (fit parameter
				  3) between day 20.1 and 20.5.
2 chatter
        chatter <chatter level>
        Control the verboseness of XPLOT. Same as in XSPEC.
2 clear
	clear
	Reset data buffers to build up a new plot. It resets the
division of the page back to one viewport. It does not affect fonts.
2 cpd
        cpd {<PGPLOT device> or none}
        This is an alias for 'setplot device'.
2 data
	data [<package no>]
	Read next 'data file' package and write data file names onto the
terminal. This command is useful to skip data sets in a history file
which contains more than you want to plot. The command creates no data 
set.
3 examples
 XPLOT> data		! Read in next 'data' package from history file.
 XPLOT> data 5		! Skip 4 'data' packages and read the fifth.
2 divide
	divide <data set 1> <data set 2>
Divides the y-values of <data set 1> by <data set 2>. Both data sets must 
have the same number of data points and should have the same x-values. 
3 examples
 XPLOT> rdfit jdate 1    ! Read fit parameter 1.
 XPLOT> rdfit jdate 4    ! Read fit parameter 4.
 XPLOT> plot             ! Plot parameter 1 and 4 vs time.
 XPLOT> divide 1 2       ! Divide fit parameter 1 (data set 1) by 
                           parameter 4 (data set 2).
 XPLOT> plot             ! Plot ratio of parameters vs time.
 ...
 XPLOT> setplot div 1 2  ! Divide screen.
 XPLOT> spectrum         ! Read spectrum.
 XPLOT> spectrum         ! Read another spectrum.
 XPLOT> plot             ! Plot both spectra in lower (1 1) panel.
 XPLOT> divide 1 2       ! Divide first spectrum by second spectrum.
 XPLOT> plot 1 2         ! Plot ratio in upper panel.
2 exit
	exit
	The command to end the current XPLOT run, and return to the main
operating system. After an 'exit', the current history and plot files are
closed.
2 fold
	fold <T0> <Tfold> [<x viewport> <y viewport>]
	Fold data along x-axis where <T0> is the start time and <Tfold> is
	the folding interval. The units must be the same as before the folding.
	The default viewport position in x and y is 1.
3 examples
  Assume a certain fit parameter is plotted versus Julian Date - 2440000
  XPLOT> fold 6233.31 8.5  ! fold data with T0=6233.31 and period of 8.5 days
2 font
	font [<font type>]
	Change character font. The available types are: 'normal',
'roman', 'italic' and 'script'. To change already written characters
on the screen use the 'plot' command after the 'font' command.
3 examples
  XPLOT> font roman		! Change font to roman.
  XPLOT> plot 			! Redraw plot with new fonts.
2 hardcopy

        hardcopy
        Make a hardcopy of the current plot and spool to the printer.

This runs the command file hardcopy.xcm (which lives in the xcoms 
sub-directory of the XANADU library directory).
2 help
	help [<topic list>]
	Obtain help on the XPLOT commands, their syntax, and examples.
3 syntax
	help [<topic list>]
The help command uses the XHELP interactive help facility.  The optional
topic list can be used to go directly to a particular topic and sub-topic.
The XHELP facility has a number of special input characters used to access
different sub-topics.  The string '??' will produce a summary of these.
To exit back to XPLOT, use an EOF (<CTRL-Z>) or type <CR> until you
leave the help facility.
3 examples
  In the following, only the results of the initial invocation (in response
  to the XPLOT> prompt) are given.  Subsequent XHELP characters and sub-topic
  names can be given, until control is returned to XPLOT via the EOF.
  XPLOT> help			! Go to the top of the help file
  XPLOT> help $			! Go to the text for the '$' command
  XPLOT> help help exam		! Go to this text
2 helpxspec
	helpxspec [{<topic list in XSPEC>]
	Obtain help on the XSPEC commands. See 'help' command in XSPEC.
2 history
	history [{<filename> or <'none'>}]
	Open XSPEC history file to read in data packages. <filename>
is the name of the file to be opened for input.
The history file contains SF format packages produced by XSPEC.
History closes the current history file if there is any and opens a
new one. The current data buffers are kept and new data can be added.
History 'none' closes the old history file and does not open a new one.
3 examples
  Assume no history file is open.
  XPLOT> history filenm	! Open file called filenm.xhs
  XPLOT> history		! Close file filenm.xhs and open it again
				  to read it again from the beginning.
  XPLOT> history filenm1.his	! Close filenm.xhs and open filenm1.his.
2 iplot
	iplot [(<x viewport> <y viewport>)...]

Interactive plotting on the current plot device.
This command works as the `plot' command (see there) but allows
you to further work on the plot interactively using the PLT package.

2 kev_ang
	kev_ang
	Convert keV into Angstrom. To be used after read in the spectrum
	and before plotting.
3 examples
  XPLOT> spectrum	! Read in next spectrum.
  XPLOT> kev_ang	! Conversion into Angstrom.
  XPLOT> plot 1 2	! Plot.
2 label
	label {<x pos> or <y pos> or <t pos> or <tl pos> or
	       <tr pos> or <in off/on/write/model> or <pos>}
	Write labels at various positions in the plot.
3 examples
  Assume 2*2 plot viewports are defined.
  XPLOT> label x The x label	  ! Writes same label on both x-axes.
  XPLOT> label x1 The x1 label    ! Writes new label on x-axis of left plots.
  XPLOT> label x2 " "             ! No label on x-axis of right plots.
  XPLOT> label y2 The y2 label    ! Writes new label on y-axis of upper plots.
  XPLOT> label t1 The header      ! Header centered on top of left plots.
  XPLOT> label tl1 Left header    ! Header on left side on top of left plots.
  XPLOT> label tr2 Right header   ! Header on right side on top of right plots.
  XPLOT> label in off		  ! Plots are by default numbered with a,b,c..
				    this command suppresses a,b,c...
  XPLOT> label in on		  ! inside labels back on
  XPLOT> label in write 1 1 low left  ! New label in lower left viewport
  XPLOT> label in model 1 1       ! Model label in lower left viewport. 
                                  ! This command should only be used in 
                                  ! combination with the spectrum bestfit 
                                  ! command to write the best fit spectral 
                                  ! model into the viewport.
  XPLOT> lab pos 1 1.5 2.5 mark   ! Writes label 1 left-justified at x=1.5 
                                    and y=2.5. Up to 10 labels can be
                                    written. This command works ONLY for 
                                    plotting contours! For other plots
                                    use iplot and the proper PLT command.
2 linear
	linear [<xpos>][<ypos>]
	Linear plotting along x and/or y axis.
3 examples
Assume you have 2*3 viewports. Initially the plots are done linear.
  XPLOT> logarith x	! Plot logarithmic along all x axes in both
			  viewport columns.
  XPLOT> linear x1 	! Plot linear along all x axes in first
			  viewport column.
  XPLOT> log y3		! Plot logarithmic along the y axes in the upper
			  viewports.
2 logarith
	logarith [<xpos>][<ypso>]
	Logarithmic plotting along x and/or y axis. See command 'linear'.
	
2 mark
	mark <xpos><ypos><size><symbol no><x viewport><y viewport>
	Draw symbol given by 'symbol no' in PGPLOT of given size at
	(xpos,ypos) in viewport x,y.
2 model
	model {<'on'> or <'off'>}
	Turn on or off the model in the plot.
3 examples
  XPLOT> spec 		! Read next spectrum in history file.
  XPLOT> plot		! Plot spectrum (initially with model if there
			  is any in the 'spectrum' package.
  XPLOT> model off	! No model.
  XPLOT> plot		! Update plot without drawing the model.
2 multiply
	multiply <data set 1> {<data set 2> or 
                               constant <constant>[<clow>][<chigh>}
Multiply the y-values of <data set 1> by <data set 2> or by a constant. 
The constant can be followed by lower and upper limits for calculating 
errors. Both data sets must have the same number of data points and 
should have the same x-values. 
3 examples
 XPLOT> rdfit jdate 1    ! Read fit parameter 1.
 XPLOT> rdfit jdate 4    ! Read fit parameter 4.
 XPLOT> plot             ! Plot parameter 1 and 4 vs time.
 XPLOT> multiply 1 2     ! Multiply fit parameter 1 (data set 1) by 
                           parameter 4 (data set 2).
 XPLOT> plot             ! Plot product of parameters vs time.
 ...
 XPLOT> rdfit jdate 1                    ! Read fit parameter 1.
 XPLOT> plot                             ! Plot vs time.
 XPLOT> multiply 1 constant 2. 1.95 2.05 ! Multiply fit parameter by 2.0. 
                                           Errors of fit parameter 1 and of
                                           2.0+-0.05 are added quadratically.
 XPLOT> plot                             ! Plot result vs time.
2 newset
	newset <x data><y data>
	Rearrange x and y from previous data sets, where <x data> and 
        <y data> are the data to plot on x and y. <x data> and <y data> 
        can be x or y data from any previously plotted data set.
3 examples
  XPLOT> history colorcolor   ! Open history file.
  XPLOT> rdfit jdate phacts 1 10 11 20 21 50  
                              ! Read spectrum packages and sum up count 
                                rates in bin 1-10, 11-20 and 21-50.
  XPLOT> plot                 ! Plot the three count rates vs time.
  XPLOT> div 2 1              ! Ratio of count rate 11-20 and 1-10 (data 
                                sets 2 and 1).
  XPLOT> plot                 ! Plot hardness ratio.
  XPLOT> div 3 2              ! Ratio of count rate 21-50 and 11-20 (data 
                                sets 3 and 2).
  XPLOT> plot                 ! Plot second hardness ratio.
  XPLOT> newset y 4 y 5       ! Rearrange first hardness ratio (y data 
                                of data set 4) to plot on x-axis and
                                second hardness ratio (y data of data 
                                set 5) to plot on y-axis.
  XPLOT> symbol -1 1-5        ! Exclude data sets 1 to 5 from further 
                                plotting.
  XPLOT> plot                 ! Plot second hardness ratio vs first hard-
                                ness ratio, i.e. make color-color diagram. 
2 norm
	norm <xlow><xhigh>
	Before plotting normalize data set to average value between xlow
	and xhigh.
3 examples
  Read in spectra and plot them normalized to the average countrate
  between 10. and 11. keV:
  XPLOT> spec		! Read next spectrum in history file.
  XPLOT> norm 10. 11.	! Divide spectrum by average value between 10.0
			  and 11.0 keV.
  XPLOT> plot 		! Plot.
  XPLOT> spec		! Read next spectrum.
  XPLOT> norm		! Divide spectrum by 10.0-11.0 average.
  XPLOT> plot 		! Plot in same viewport.
2 pause
	pause
	The command to exit from the program and return to the main
operating system.
3 syntax
	pause
 
    After a 'pause', the current plot files are closed.
 
VAX VMS specific notes:  The program is actually exited with a FORTRAN
'pause' statement.  This allows the user to execute a limited selection
of VMS commands (those that do not effectively 'run' a new process) and
then return to XPLOT using the VMS 'continue' command.  In particular,
the default directory can be modified. Note that when XPLOT is re-entered
any previously opened plot files were closed, and thus plotting must be
explicitly re-opened using the 'setplot device' command.
 
A VMS example:
xplot> pause			! Leave XPLOT with the Fortran pause.
$ set default [common.newdir]	! Reset the current default director to the
				  [common.newdir] directory.
$ continue			! Return to XPLOT.
xplot> setplot device "/te"	! Reopen the plot device to a tektronix.
2 plcont
	plcont [<minimum chi-square><no of contours>
			<offset levels>...<viewport> <y viewport>]
	Plot chi-square contours. The grid of chi-square values is
stored in the 'steppar' history file package and can be read in with the
'rdcont' command.
The default <minimum chi-square> is the value read from the 'steppar'
package. The default <no of contours> is 4 with <offset levels> of
1., 2.71, 4.61 and 9.21.
The 'rdcont' command switches XPLOT in 'contour mode'. Only contours can
be plotted until a reset is done with the clear command.
To write labels on the plot the usual commands can be used and 'plot' or
'plcont' will update then the plot.
3 examples
  Assume your total page is divided into 1*2 viewports.
  XPLOT> rdcont		  ! Reads next 'steppar' package from history file
  XPLOT> plcont		  ! Plots 4 contours with delta chi-square of
			    1. 2.71 4.61 and 9.21 in lower panel
  XPLOT> rdcont
  XPLOT> plcont,,3,1. 2. 3. 1 2  ! Plots 3 contours with delta chi-square of
				   1. 2. and 3. in upper panel
				   Two contour plots on top of each other
				   should only be done when the same fit
				   parameter is plotter along the x-axis.
2 plot
	plot [(<x viewport> <y viewport>)...]
	Plot current data set(s) into viewport(s).
The last read in data set(s) will be plotted into the viewport(s) in
column <x viewport> and row <y viewport>. 
3 examples
  Assume your total page is divided into 3*2 viewports.
  XPLOT> spectrum	! Read next spectrum from history file.
  XPLOT> plot 1 2       ! Plot into upper left viewport.
  XPLOT> residuals      ! Calculate residuals from fitted model. 
  XPLOT> plot 1 1       ! Plot into lower left viewport.
  XPLOT> spectrum
  XPLOT> plot 2 2       ! Plot into upper middle viewport.
  XPLOT> residuals
  XPLOT> plot 2 1       ! Plot into lower middle viewport.
  XPLOT> spectrum
  XPLOT> plot 3 2       ! Plot into upper right viewport.
  XPLOT> residuals
  XPLOT> plot 3 1       ! Plot into lower right viewport.

  The same can be done with one single plot command:

  XPLOT> spectrum	! Read next spectrum from history file.
  XPLOT> residuals      ! Calculate residuals from fitted model. 
  XPLOT> spectrum
  XPLOT> residuals
  XPLOT> spectrum
  XPLOT> residuals
  XPLOT> plot 1 2,1 1,2 2,2 1,3 2,3 1 	! Plot the 3 spectra into the 
                        upper viewports and residuals into the lower 
                        viewports. The commas are equivalent to spaces 
                        and only used here to better seperate viewports. 
                        The viewport positions must be given in the same 
                        order as the data sets are read in. The 1st 
                        spectrum goes into viewport (1 2) the residuals 
                        of the 1st spectrum go into (1 1). The 2nd 
                        spectrum goes into (2 2) and so on.
  XPLOT> setplot dev file.ps/ps
  XPLOT> plot           ! Create post script file with plot.
2 wrqdp
	wrqdp <file name><data set 1,2...>
	Write x, error on x, y, error on y, of given data sets as four
	columns into file with default extension '.qdp'. The errors are
	averaged two sided errors.
2 rdcont
	rdcont
	Read 'steppar' package from history file.
The 'plcont' command can then be used to make a chi-square contour plot.
For further information see there.
2 rdfit
	rdfit <sub command string>
    Read fit results. <sub command string> can be a keyword followed
in some cases by arguments and one fit parameter number or 2 fit
parameter numbers which can then be plotted against each other.
'Rdfit' searches through the history file from the current position
until the end for 'fit' packages. 'Error' packages are also used
if there are any. When the end of the history file is reached
it will be closed and opened from the beginning for further processing.
3 examples
  XPLOT> setpl div 1 2	! Divide plot into 2 viewports.
  XPLOT> rdfit 1 2	! Read fit parameter 1 for plotting along x
			  axis and parameter 2 for y axis from all
			  fit packages found in the history file.
  XPLOT> plot 1 1	! Plot parameter 2 versus parameter 1 in
			  lower viewport.
  XPLOT> rdfit 1 3	! Read fit parameter 1 for plotting along x
			  axis and parameter 3 for y axis.
  XPLOT> plot 1 2	! Plot parameter 3 versus parameter 1 in
			  upper viewport.
3 chi_squa
	chi_squa <no of free parameters>
	Plot reduced chi square.
4 examples
  XPLOT> rdfit day 1985 chi 50	! Read chi square from 'fit' package in
				  history file and calculate reduced chi
				  square (50 degrees of freedom) to plot
				  it versus day no in 1985.
3 day_year
	day_year <year>
	where <year> is the year of which day numbers are used for the x-axis.	
The time is read from the PHA files and therefore the 'data' package
which contains the PHA file names must be in the history file (the
history file must be opened before the data is read in XSPEC)
4 examples
  XPLOT> setpl div 1 2	   ! Divide plot into 2 viewports.
  XPLOT> rdfit day 1985 1  ! Read time from PHA files and convert it
			     into day of 1985 to plot along x and fit
			     parameter 1 along y axis.
  XPLOT> plot 1 1	   ! Plot parameter 1 versus time in lower viewport.
  XPLOT> rdfit,,,2
  XPLOT> plot 1 2	   ! Same as above with fit parameter 2 in upper
			     viewport.
3 eqwidth
	eqwidth <package no>
	Read the <package no>th equivalent width package after the fit 
        package. If there is more than one equivalent width packages for 
        the same model parameters (e.g. from different model components), 
        then the equivalent width packages after each fit must be in the
        same order to get a useful plot.
4 examples
  XPLOT> rdfit jdate eqwidth ! Read the 1st equivalent width package after 
                               the fit package for plotting versus Julian 
                               date.
  XPLOT> plot		     ! Plot equivalent width versus time.
  XPLOT> clear		     ! Reset plotting.
  XPLOT> rdfit eqwidth 2 4   ! Read the 2nd equivalent width package after 
                               the fit package and read parameter 4.
  XPLOT> plot		     ! Plot fit parameter 4 versus equivalent 
                               width.
3 flux
	flux <package no>
	Read the <package no>th flux package after the fit package and 
        extract the flux in erg cm^-2 s^-1.
	If there is more than one flux package for the same model
        parameters (e.g. different energy ranges), then the flux
        packages after each fit must be in the same order to get a 
        useful plot.
4 examples
  XPLOT> rdfit jdate flux    ! Read the 1st flux package after the fit
			       package for plotting versus Julian date.
  XPLOT> plot		     ! Plot flux versus time.
  XPLOT> clear		     ! Reset plotting.
  XPLOT> rdfit flux 2 5      ! Read the 2nd flux package after the fit
			       package and read parameter 5.
  XPLOT> plot		     ! Plot fit parameter 5 versus flux.
3 phflux
	phflux <package no>
	Read the <package no>th flux package after the fit package and 
        extract the flux in photons cm^-2 s^-1.
	See the 'rdfit flux' command.
3 jdate
	jdate
	Time along x-axis in Julian Date - 2440000. See also 'rdfit
day_year' command.
4 examples
  XPLOT> setpl div 1 2	   ! Divide plot into 2 viewports.
  XPLOT> rdfit jdate 1	   ! Julian Date along x and fit parameter 1 along y.
  XPLOT> plot 1 1 	   ! Plot parameter 1 versus time in lower viewport.
  XPLOT> rdfit,,2	   ! Same as above with fit parameter 2.
  XPLOT> plot 1 2 	   ! Plot parameter 2 versus time in upper viewport.
3 luminosity
	luminosity <package no> <distance/kpc>
	Read the <package no>th flux package after the fit package
	(see flux option) and convert the flux into luminosity for the
        given distance in kpc.
4 examples
  XPLOT> rdfit day 1985 lumi 1 2.  ! Read the 1st flux package after the fit
			             package and convert it into luminosity
                                     for a distance of 2.0 kpc.
  XPLOT> plot		           ! Plot luminosity versus day in 1985.
3 phacts
	phacts < <start bin> <end bin> >...
	Read the spectrum package created by the 'dump ecdata' command
        of XSPEC and sum up count rate and error between start and end
        bin. Up to 10 sets of <start bin> <end bin> can be given.
4 examples
  XPLOT> set div 1 4                ! Create 4 viewports.
  XPLOT> rdfit day 1985 phacts 1 10 ! Read the spectrum packages and add
                                      bins 1-10.
  XPLOT> plot 1 1	            ! Plot 1-10 count rate vs time in 
                                      lower viewport.
  XPLOT> rdfit,,,,11 60             ! Read the spectrum packages and add
                                      bins 11-60.
  XPLOT> plot 1 2	            ! Plot 11-60 count rate in second viewport.
  XPLOT> divide 2 1		    ! Divide data set 2 by data set 1 to
                                      produce hardness ratio.
  XPLOT> plot 1 3                   ! Plot hardness in third viewport.
  XPLOT> rdfit,,,,11 30 31 60       ! Read the spectrum packages and add
                                      bins 11-30 and 31-60.
  XPLOT> plot 1 4                   ! Plot 11-30 and 31-60 count rates 
                                      in top viewport.
3 modcts
	modcts < <start bin> <end bin> >...
	Read the spectrum package created by the 'dump ecdata' command
        of XSPEC and sum up model count rate between start and end
        bin. See 'rdfit phacts' command.
3 phase
	phase
	Phase along x-axis. The phase is read from the `selectors' 
package in the PHA files. 
4 examples
  XPLOT> setpl div 1 2	   ! Divide plot into 2 viewports.
  XPLOT> rdfit phase 1	   ! Phase along x and fit parameter 1 along y.
  XPLOT> plot 1 1 	   ! Plot parameter 1 versus phase in lower viewport.
  XPLOT> rdfit,,2	   ! Same as above with fit parameter 2.
  XPLOT> plot 1 2 	   ! Plot parameter 2 versus phase in upper viewport.
3 seconds
	seconds <year> <day> <hour> <minute> <second>
	Read time in seconds after reference time given by <year> 
<day> <hour> <minute> and <second>. The year, day, hour and minute must 
be given as integer numbers, whereas seconds can be given as real 
number. The time is read from the PHA files and therefore the 'data' package
which contains the PHA file names must be in the history file (the
history file must be opened before the data is read in XSPEC). This 
option is useful for plotting data from short time intervals, e.g. 
spectral properties of an X-ray burst after burst onset. 
4 examples
  XPLOT> setpl div 1 2	                 ! Divide plot into 2 viewports.
  XPLOT> rdfit sec 1985 231 2 5 12.25 1  ! Read time from PHA files and 
                                           convert it to seconds after 
                                           1985 day 231 02:05:15.25 to plot 
                                           along x and fit parameter 1 
                                           along y axis.
  XPLOT> plot 1 1                        ! Plot. 
  XPLOT> rdfit,,,,,,,2
  XPLOT> plot 1 2                        ! Same as above with fit parameter 
                                           2 in upper viewport.
2 rdqdp
	rdqdp <file name> <columns>
        Read data from a file in QDP format. The file currently can have 
up to five columns and <columns> specifies what the columns contain. 
<columns> consists of a character string for each column. An `x' stands 
for column contains data to plot along the x-axis. The same for `y' 
along the y-axis. `ex' and `ey' indicate errors and `m' a model. The 
default extension for the file is `.qdp'.
3 examples
  XPLOT> rdqdp file1 x ex y ey  ! Read data from file `file1.qdp' which 
                                  contains as first column x-data, as 
                                  second column errors on x. The third 
                                  and fourth column contain y-data and 
                                  errors.
  XPLOT> rdqdp file2 x ex m     ! Read model from file `file2.qdp'.
2 rdmod
	rdmod
	Read next 'photon' package. This package contains the model
spectrum in photons/cm**2 s keV. The command works in the same way as
the 'spectrum' command. To plot 'unfolded' spectra see the 'unfoldspec'
command.
2 reexecute
	reexecute [<command number list>]
Reexecute with no argument provides a list of the last up to 20 commands.
A desired selection of these can then be reexecuted by number. This
command DOES NOT recall previous commands to the command line for
changing. It is useful for repeating a sequence of commands.
<command number list> is a list of numbers and/or number ranges which
denote previously called commands.
3 examples
  XPLOT> reex	       ! Provides list of the last commands (maximum 20)
  XPLOT> reex 4 15-18  ! Executes immediately commands 4,15,16,17,18 again.
2 rescale
	rescale {<x pos> or <y pos>} <lower limit> <upper limit>
	Change plot limits. <x pos> and <y pos> determine the viewports
for which the new scaling is applied to.
3 examples
Assume 2*3 viewports are defined.
  XPLOT> resc x 0. 10.	   ! New scaling on all x axes.
  XPLOT> resc x1 0. 11.	   ! New scaling on x axes on left column of viewports.
  XPLOT> resc y3 0.01 .02  ! New scaling on y axes on the top viewports.
2 residuals
	residuals <data set>
	Subtract model from data.
3 examples
Assume you have divided your page into 2$\ast$2 viewports.
  XPLOT> spectrum	! Read next 'spectrum' package.
  XPLOT> plot 1 2	! Plot spectrum into upper left viewport.
  XPLOT> residuals 1	! Obtain residuals from data set no 1.
  XPLOT> plot 1 1	! Plot residuals into lower left viewport. These
			  residuals are now data set no 2!
  XPLOT> spectrum	! Read next 'spectrum' package.
  XPLOT> plot 2 2	! Plot spectrum into upper right viewport.
  XPLOT> residuals 3	! Obtain residuals from data set no 3.
  XPLOT> plot 2 1	! Plot spectrum into lower right viewport.
2 setplot
	setplot <sub command string>
	Set one of the various plot options.  <sub command string> is a keyword
	followed in some cases by arguments.
3 command
     setplot command <PLT_command>

where PLT_command is any valid PLT command.  Every time you use
'setplot command' that command is added to the list that is passed to
PLT when you use plot or iplot.  The most common use of 'setplot command'
is to add a common label to all plots produced.  You should be careful
when using this command since XPLOT does not check to see if you have
entered a valid PLT command.  These commands are appended to the list
that XPLOT creates to generate the plot and so 'setplot command' will
over-ride these values (this can either be a bug or a feature, depending
on what you have done!)

See also 'setplot delete' and 'setplot list'.

4 Example

  XPLOT> setplot command label ot Crab data    ! Add the label 'Crab data' to
                                                 future plots.
3 delete
     setplot delete {command_number}

where command_number is the number of a PLT command that had previously
been entered using 'setplot command'.  This command is used to delete
commands from the list passed to PLT when you use the XPLOT plot or
iplot commands.

4 Examples
XSPEC> setplot com LAbel OT Testing   ! PLT label command
XSPEC> setplot com LWidth 5           ! PLT line width command
XSPEC> setplot lis                    ! List the PLT command stack
 1: LAbel OT Testing
 2: LWidth 5
XSPEC> setplot del 1                  ! Delete the first command in the stack
XSPEC> setplot lis
 1: LWidth 5

3 list
     setplot list

This command is used to list out all the commands that have been entered
using 'setplot command'.  See 'setplot delete' for an example of use.

3 device
	setplot device [ <PGPLOT device> ]
	XPLOT looks for the logical 'PGPLOT_DEVICE' and if the logical 
is defined it uses it to set the device for interactive plots. Setplot 
device can be used to set the device if the logical is not defined or to 
change the device. 
4 syntax
	setplot device [ <PGPLOT device> ]
where <PGPLOT device> is a string that gives an (optional) file name and device
plot type (see the PGPLOT documentation for options available).
4 examples
  XPLOT> setplot device /te	      ! Set device to the terminal.
  XPLOT> setplot device filenm.ps/ps  ! Open post script file for laser printer.
  XPLOT> setplot device filenm.ps/vps ! As above but use page vertical.
3 division
	setplot division [<x division>] [<y division>]
	Divide your page in <x division>*<y division> viewports. The current
maximum is 3*5 little plots on one page. A clear resets the divisions
to 1 (*1). <x divisions> and <y division> are the number of viewports in
horizontal and vertical direction. The frames are adjacent and are
numbered only at the bottom and on the left plot.
4 examples
  XPLOT> setplot division 1 3   ! divide page into 3 viewports vertically.
  XPLOT> setplot divi 3 2       ! 3 plots in horizontal and 2 in vertical
				    direction.
2 Show
        show
        Give information on current data sets.
2 Spectrum
	spectrum [<sub command>]
	Read next 'spectrum' package if no <sub command> is given. 
3 examples
  XPLOT> setplot division 1 2   ! divide page into 2 viewports vertically.
  XPLOT> data                   ! go to next data package in history file.
  XPLOT> spectrum               ! read next spectrum. 
  XPLOT> data                   ! go to next data package in history file.
  XPLOT> spectrum               ! read next spectrum. 
  XPLOT> plot 1 1 1 2           ! plot first spectrum in lower (1 1) and 
                                  2nd spectrum in upper (1 2) viewport. 
3 bestfit
	spectrum bestfit
	Search through history file for best fit model and read 
'spectrum' package for this model. The model can be written into the 
viewport using the label command (see there).
4 examples
  XPLOT> data                   ! go to next data package in history file.
  XPLOT> spectrum bestfit       ! search best model fit and read spectrum. 
  XPLOT> plot 1 1               ! plot best fit model and spectrum
  XPLOT> label in model 1 1     ! write spectral model into the viewport.

2 Symbol
	Symbol <symbol no> [<data set range>]
	Change symbol for data points for a certain data set.
The <symbol no> specifies the kind of symbol plotted at the data point
(see you PGPLOT manual for possible symbols). The initial value is 1, 
producing a small dot.
The <data set no> can be a list of numbers which define on which data set the
symbol is to be used (one has to remember in which order the data sets on the
different viewports were plotted). If no list is given then the symbol is
plotted on the last data set. A negative <symbol no> will exclude
the given data set from plotting.
3 examples
  Assume 5 spectra are plotted in various viewports (can be 3 in one single
  viewport and the other 2 in separate viewports).
  XPLOT> symbol 4 1-3 5	  ! Plot small open circles on the data points
			    of spectrum 1,2,3 and 5.
  XPLOT> symbol 9 3	  ! Plot symbol 9 on spectrum 3.
  XPLOT> symbol 6	  ! Plot symbol 6 on spectrum 5 (the last plotted).
  XPLOT> symbol -1 5	  ! Spectrum 5 will not be plotted in following
			    updates of the plot.
2 unfoldspec
	unfoldspec <data set no PHA><data set no photon>
	To plot the 'unfolded' observed spectrum using the 'spectrum'
package which contains PHA spectrum and folded model and the 'photon'
package which contains the photon model spectrum.
3 examples
  XPLOT> set div 1 3		! Open 3 viewports in vertical direction.
  XPLOT> spectrum		! Read PHA spectrum.
  XPLOT> plot 1 3		! Plot on upper viewport.
  XPLOT> rdmod			! Read photon model spectrum.
  XPLOT> plot 1 2		! Plot on second viewport.
  XPLOT> unfoldsp 1 2		! Unfold PHA spectrum (data set no 1)
				  using the corresponding folded model
				  and the photon model spectrum (data set
				  no 2).
  XPLOT> plot 1 1		! Plot on lower viewport.
2 viewport
	viewport {<x> or <y>} [<size>...]
	Change individual size of viewports.
<x> or <y> denotes in which direction the viewport sizes are to be
changed. Then a set of viewport sizes follow. Omitting the sizes will
reset the viewports to equal size.
3 examples
  XPLOT> setplot division 1 2   ! Divide page into 2 viewports vertical.
  XPLOT> ...			! Plot some data.
  XPLOT> viewport y 0.3 0.7 	! Apportion 30% of the page in vertical
				  direction to lower viewport and 70% to
				  upper viewport.
  XPLOT> viewport y 		! Reset sizes to 50% for both viewports.
2 standardmacros
	@macroname
	Execute standard command files containing often used sequences 
of commands. Standard macros reside in a command file directory which is 
open to all users.

3 resid
	@resid
	Command file to read the next 'spectrum package' in the history 
file, plot the spectrum and model in a top viewport and the residuals in 
a smaller viewport below the spectrum. The command file can be invoked 
several times consecutively to go spectrum by spectrum through a history 
file.

3 resid2
	@resid2
	As 'resid' but for 'spectrum packages' containing two spectra 
(which are handled as two data sets by XPLOT) from a simultaneous fit 
in XSPEC. 
