spec

Software for Diffraction

setplot

set plotting options

SYNOPSIS

setplot [value]

DESCRIPTION

The setplot macro asks the following questions:

   1) Do real-time plots during scans (YES)?
   2) Do screen plot after scan (YES)?
   8) Range x axis with scan min and max (NO)?
  16) Force y-axis minimum to zero (NO)?
  32) Use logarithmic y-axis (NO)?
  64) Use background subtraction (NO)?
 128) Use high resolution plotting device (YES)?
        What kind of high-res graphics (x11)?
 256) Draw large dots at points (YES)?
 512) Connect points with lines (YES)?
1024) Draw error bars (YES)?
      Sum of selections is 131.

The numbers before each question are added and printed after all options are selected. You can quickly select the same set of options by invoking setplot with that number.

Selecting option 1 causes the otherwise null macro scan_plot to be defined as rplot. The rplot macro creates updated plots during scans using the internal plotting functions.

The various combinations of options 2 and 4 are used to select a definition for the plot macro, which is invoked at the end of each scan. The plot macro will be defined to possibly include the macros splot and lp_plot. The splot macro uses the internal plotting and screen formatting functions to plot the current data on the screen, while the lp_plot macro uses the internal plotting functions to plot data on a 132-column printer. In any case, the plot macro includes the plot_res macro, which prints out summary information from the scan.

Selecting option 8 forces the scan data to encompass the entire x axis. Otherwise the x-axis ranges are rounded out to rational numbers.

Option 16 forces logarithmic scaling for the y axis.

Option 32 forces the minimum for the y axis to be zero, no matter where the data points lie.

Option 64 selects a different method of doing the scan analysis. When this option is selected, a linear background is calculated for each scan using the scan endpoints. The number of endpoints that are averaged together is given by the global variable bg_pts (default is 1). The resulting linear background is subtracted from each point. The quantities printed out as the peak position, sum, FWHM and center of the FWHM are calculated after the background is subtracted.

Option 128 selects high-resolution graphics mode. If selected, you will be prompted for the high-resolution device you are using. Recognized device names include vga, ega, herc, sun and x11. By default, the high-resolution plots are drawn with large dots around each point and lines connecting the points. Options 256 and 512 allow you to turn the dots and lines off. Also by default, error bars are drawn, with the height of each error bar proportional to the square root of the y values, as appropriate for counting statistics. Option 1024 lets you turn off error-bar mode. spec initially uses the value of the environment variable GTERM, which can be set in your .login file, to select the type of high resolution display you are using. (You can, however, change GTERM while spec is running.

GLOBALS

PL_G
global variable holding data group used for plotting, normally zero.
PL_G1
global variable holding data group used to hold background-subtracted data, normally one.
PL_X
global variable holding data element used for x axis, normally zero.
PL_Y
global variable holding data element used for y axis, normally one.
splot_col
global variable holding string describing colors for end-of-scan plots on high-res devices, may default to "6:5:9:3:2", corresponding to cyan outer background, yellow inner background, black text, red axis and blue symbols.
rplot_col
global variable holding string describing colors for runtime plots on high-res devices, may default to "5:6:9:3:2", corresponding to yellow outer background, cyan inner background, black text, red axis and blue symbols.
BG
global variable holding a flag that if set, indicates to use the background-subtracted data in the analysis results and plots produced by the plot macro. It is important to make sure the do_bg macro is called to calculate the background-subtracted data before using macros such as pl_FWHM that look at the value of BG to determine which data group to analyze. The various standard definitions for the plot macro will call do_bg when appropriate.
PLOT_MODE
global variable containing the code representing the current plotting options.
bg_pts
global variable that holds the number of endpoints of a scan to average together to calculate the linear background.

MACROS

plot
defined according to the selected options, and invoked by the scan macros to do the end-of-scan plotting and analysis.
scan_plot
defined either as rplot or nothing, and invoked after each point in a scan is taken to do the real-time scan plotting.
YMIN
defined either as "0" or "auto" and determines how the y-axis minimum range is set.

EXAMPLE

setplot 3

SEE ALSO

plot splot lp_plot