spec

Software for Diffraction

plot_cntl()

control of built-in plotting

DESCRIPTION

plot_cntl(s)

Selects built-in plotting features. The argument s is a string of comma- or space-delimited options. The following options may be preceded by a minus sign to turn the associated feature off or nothing (or an optional plus sign) to turn the feature on. A question mark before or after the option will return a value of one or a zero that indicates whether the associated feature is currently on or off. For example,

plot_cntl("xlog,ylog")    # turns x and y log-axis mode on
plot_cntl("+xlog")        # turns x log-axis mode on
plot_cntl("-xlog")        # turns x log-axis mode off
print plot_cntl("xlog?")  # returns 1 if mode on, else 0
"xlog"
Use a logarithmic x axis.
"ylog"
Use a logarithmic y axis.
"xexact"
Force x-axis minimum and maximum to be set to the scan endpoints (as opposed to being rounded).
"colors"
Enable the use of colors.
"dots"
Draw graphics-mode points with large dots.
"lines"
Connect graphics-mode points with lines.
"ebars"
Draw vertical lines through each point of length equal to the twice the square root of the y value.
"grid"
Draw grid lines at each tick mark. (As of spec release 6.03.09.)
"persist"
Keep graphics-mode on after ordinary user input. spec errors, a ^C from the keyboard or plot_cntl("close") restore text mode.
"perpetual"
Keep graphics-mode on continuously (appropriate if using X windows, for example).
"ascii"
Draw plots on the terminal window using cursor positioning commands and ASCII characters rather than using the high-resolution x11 window.
"dumbterm"
Indicates a terminal window that lacks cursor positioning. The value is set automatically when spec starts up. When this mode is on, text plots are drawn down the page using only space characters to position the plotted points. Note when this mode is on, the special control strings used by the tty_cntl() and the positioning used by tty_move() are unavailable.

Other options are:

"font=string"
Sets the font used for the x11 high-resolution plot windows. If the font is a scalable font, its size will be chosen to match the current size of the plot window. Otherwise, the font size will be fixed to either the value specified in the font name using the X Logical Font Description Conventions XLFD, or if the size fields are wild carded, the font size will be selected by the X server.
"title=string"
Sets the title-bar text for x11 high-resolution plot windows. In a comma-separated list of arguments to plot_cntl(), this one must appear last.
"geometry=string"

Sets the size and position for x11 high-resolution plot windows. The format of the geometry string is the same as expected by standard X windows applications, as in

plot_cntl("geometry=512x380-0+10")

As with the conventional syntax, not all parts of the geometry string are required.

"colors=bgnd:win:text:axis:symb:..."

Assign colors for drawing the various graphics-mode elements. The values for bgnd (the background color of the area outside the axis), win (the background color of the area inside the axis), text (the color of the text), axis (the color of the axis) and symb ... (the color of the plotting symbols) are integers. The first 10 colors are standardized according to the following table:

0 - background (normally white or black)
1 - foreground (normally black or white)
2 - blue
3 - red
4 - green
5 - yellow
6 - cyan
7 - magenta
8 - white
9 - black

Other colors may be available depending on the particular device. You don't have to assign values to all colors.

"colors[numb]"
Returns the current color assignments, where numb is a number between zero and 67. Numbers zero through three return the colors assigned to the bgnd, win, text and axis elements respectively. Numbers from 4 through 67 return the colors assigned to the plotting symbols.
"dotsize=numb"
Sets the dot size to numb when drawing points. Valid values for numb are from 1 to 15. Invalid values set the dot size to the default. (As of spec release 6.03.09.)
"dotsize?"
Returns the current dot size. (As of spec release 6.03.09.)
"width=numb"
Sets the line width to numb when drawing lines. Valid values for numb are from 1 to 6. Invalid values set the line width to the default. (As of spec release 6.03.09.)
"width?"
Returns the current line width. (As of spec release 6.03.09.)
"filter1"
Select filter 1 (the default). All plotting commands are directed to this filter.
"filter2", "filter3", "filter4", "filter5"
Select filters 2 through 5. Subsequent plotting commands are directed to the selected filter.
"open"

Turn on graphics mode. If there is no graphics filter program currently active for the current filter number (see above), the filter program associated with the current GTERM variable is started. The only currently useful value for GTERM is x11. When using X11 graphics, you can assign a value to the built-in variable DISPLAY before a call of plot_cntl("open") to set the X display on which the plot will be drawn. If the filter is currently open, and you wish to change the display, use plot_cntl("kill") first. For example,

DISPLAY="host1:0"; plot_cntl("filter1,open")
DISPLAY="host2:0"; plot_cntl("filter2,open")

will create plot windows on two different hosts.

"open?"
Returns nonzero if the currently selected filter process is running. Otherwise returns zero. (As of spec release 6.03.07.)
"close"
Turn off graphics mode, unless the perpetual or persistent mode has been selected.
"kill"
Turn off graphics mode and terminate graphics process.
"erase"
Clear the graphics-mode screen (or the text screen if graphics mode is off).
"raise"
Raises the x11 high-resolution plot window to the top of the desktop window stack, making it visible.
"addpoint"
Before a call to array_plot() or data_plot() will cause the plot to be made with minimal redrawing. Used for updated plotting during scans.
"addline"
Before a call to array_plot() or data_plot() will prevent the current data from being erased and the new data from changing the ranges when the new data points are drawn. Used for plotting several data sets from different data groups or array elements on top of each other.
"mca"
Before a call to array_plot() or data_plot() will cause the data points to be displayed using a minimal redrawing algorithm, appropriate for displaying data actively being accumulated by an MCA-type device. The "dots" and "ebars" modes must be turned off.
"lp"
Before a call to array_plot() or data_plot() will generate printing instructions appropriate for plotting on a 132-column printer.