next up previous contents index
Next: Simulation Option Variables Up: Variables Previous: Command-Specific Variables   Contents   Index


Plot Variables

These variables control the numerous plotting modes and capabilities of the plot, hardcopy, xgraph, and asciiplot commands. Most of these variables can be set indirectly from the Plot Options panel and the Colors panel in the Tools menu of the Tool Control window.

colorN
If a variable with the name ``colorN'' (N 1-19) is set to the name of a color the N'th value used in a window will have this color. The value of color0 denotes the background color and color1 denotes the grid and text color. The color names recognized are those found in the rgb.txt file in the X-window system library. These mappings are built into WRspice and apply whether or not X is being run. The colors can also be set using the panel brought up by the Colors button in the Tools menu, and can be set through the X-resource mechanism (see 3.4) and the setrdb command.

The ``name'' for a color can be given in HTML-style notation: #rrggbb, where rr, gg, bb are the hex values for the red, green and blue component of the color.

combplot
This is a keyword of the plotstyle variable, or can be set as a boolean. It directs the use of a comb plot (histogram) instead of connected points. Each point is connected to the bottom of the plot area by a line.

curanalysis
This read-only variable is set to the name of the analysis when analysis starts, and retains the value until a new analysis starts. Possible values are
ac dc op tran tf noise disto sens, or not set.
This can be used in a .postrun block to make actions specific to analysis type.

Example

.postrun
strcmp("tran", $curanalysis)
if ($? = 0)
print v(1) v(2) > tranout.prn
end
.endc

curplot
This variable holds the name of the current plot. It can be set to another plot name (as listed in the plots variable), which will become the current plot. This variable can also be set to ``new'', in which case a new, empty plot is created and becomes the current plot.

curplotdate
This read-only variable contains the creation date of the current plot.

curplotname
This read-only variable contains a description of the type of simulation which produced the current plot. Note that this is not the name used by the setplot command, but rather a description of the type of simulation done.

curplottitle
This read only variable contains the title of the circuit associated with the current plot.

gridsize
If this variable is set to an integer greater than zero and less than or equal to 10000, this number will be used as the number of equally spaced points to use for the X-axis when plotting in the plot command. The plot data will be interpolated to these linearly spaced points, and the use of this variable makes sense only when the raw data are not equally spaced, as from transient analysis with the steptype variable set to nousertp. Otherwise the current scale will be used (which may not have equally spaced points). If the current scale isn't strictly monotonic, then this option will have no effect. The degree of the interpolation is given by the variable polydegree.

gridstyle
This variable is used to determine the style of grid used by the commands plot, hardcopy, and asciiplot. It can be set to one of the following values:

lingrid Use a linear grid
loglog Use a log scales for both axes
xlog Use a log scale for the X axis
ylog Use a log scale for the Y axis
polar Use a polar grid
smith Transform data and use a Smith grid
smithgrid Use a Smith grid

group
This is a keyword of the scaletype variable, or can be set as a boolean. It indicates the use of common scales for three categories of data: voltages, currents, and anything else. Each group will have its own Y-scale.

hcopycommand
This variable specifies the operating system command which the hardcopy command will use to send a job to the printer. If the string contains the characters ``%s'', those characters will be replaced by the name of the file being used to store the plot data, otherwise the file name will be appended to the end of the string, separated by a space character. This allows reference to the file in the middle of the string. For example, suppose that your site has some strange printer, but that there is a filter which converts PostScript to a format recognized by that printer. The command string might be ``myfilt <%s |lpr -Pstrange_printer''. Note that double quotes must be used in the set command since the string contains space:
set hcopycommand = "myfilt <%s |lpr -Pstrange_printer"

hcopydriver
This variable specifies the default driver to use in the hardcopy command. The variable should be set to one of the following keywords:

Keyword Description
hp_laser_pcl mono HP laser
hpgl_line_draw_color color HPGL
postscript_bitmap mono PostScript
postscript_bitmap_encoded mono PostScript, compressed
postscript_bitmap_color color PostScript
postscript_bitmap_color_encoded color PostScript, compressed
postscript_line_draw mono PostScript, vector draw
postscript_line_draw_color color PostScript
windows_native Microsoft Windows native
image tiff, gif, jpeg, png, etc. images
xfig_line_draw_color format for the xfig program

These drivers correspond to the drivers available in the format menu of the Print panel from the plot windows.

For PostScript, the line draw drivers are most appropriate for SPICE plots. The bitmap formats will work, but are less efficient for simple line drawings. More information on these drivers can be found in 3.13.1.

If this variable is set to one of these formats, Print panels from new plot windows will have this format set initially. Otherwise, the initial format will be the first item in the format menu, or the last format selected from any plot window.

hcopyheight
This variable sets the default height of the image on the page, as measured in portrait orientation, used by the hardcopy command. It is specified as a floating point number representing inches, unless followed by ``cm'' (without space) which indicates centimeters. The default is typically 10.5 inches, but this is driver dependent.

hcopylandscape
This boolean variable, used by the hardcopy command, will cause plots to be printed in landscape orientation when set.

hcopyresol
This variable sets the default resolution used by the driver to generate hardcopy data in the hardcopy command. In almost all cases, the default resolution which is achieved by not setting this variable is the best choice. One case where this may not be true is with the hp_laser_pcl driver, where the choices are 75, 100, 150, and 300 (default 150).

hcopyrmdelay
When a plot or page is printed, a temporary file is produced in a system directory (/tmp by default), and by default this file is not removed. There does not appear to be a portable way to know when a print job is finished, or to know whether the print spooler requires the existence of the file to be printed after the job is queued, thus the default action is to not perform any cleanup.

If this variable is set to an integer value larger than 0, it will specify that a temporary print file is to be deleted this many minutes after creation.

The at command, available on all Unix/Linux/OS X platforms (but not Windows) is used to schedule deletion, which will occur whether or not WRspice is still running. For this to work, the user must have permission to use at. See ``man at'' for more information.

This variable can also be set from the hardcopy page in the Plot Options tool from the Tools menu of the Tool Control window, in Unix/Linux/OS X releases.

hcopywidth
This variable sets the default width of the image on the page, as measured in portrait orientation, used by the hardcopy command. It is specified as a floating point number representing inches, unless followed by ``cm'' (without space) which indicates centimeters. The default is typically 8.0 inches, but this is driver dependent.

hcopyxoff
This variable sets the distance of the image from the left edge of the page, viewed in portrait orientation, used by the hardcopy command. It is specified as a floating point number representing inches, unless followed by ``cm'' (without space) which indicates centimeters. The default is typically 0.25 inches, but this is driver dependent.

hcopyyoff
This variable sets the vertical position of the image on the page, viewed in portrait orientation, used by the hardcopy command. Some drivers measure this distance from the top of the page, others from the bottom. This is a consequence of the internal coordinate systems used by the drivers, and the lack of assumption of a particular page size. The offset is specified as a floating point number representing inches, unless followed by ``cm'' (without space) which indicates centimeters. The default is typically 0.25 inches, but this is driver dependent.

lingrid
This is a keyword of the gridstyle variable, or can be set as a boolean. It specifies use of a linear grid. This is the default grid type.

linplot
This is a keyword of the plotstyle variable, or can be set as a boolean. It specifies the display of plot data as points connected by lines. This is the default.

loglog
This is a keyword of the gridstyle variable, or can be set as a boolean. It specifies use of a log-log grid.

multi
This is a keyword of the scaletype variable, or can be set as a boolean. It indicates the use of separate Y-scales for each trace of the plot (the default).

nobreak
If set, suppress page breaks when doing an asciiplot. The nopage variable is similar, but suppresses page breaks in both the asciiplot and print commands.

noasciiplotvalue
If set, suppress printing the value of the first variable plotted with asciiplot on the left side of the graph.

nogrid
Setting this boolean variable specifies plotting without use of a grid. The data will be plotted with only the border lines at the bottom and left sides of the plotting area.

nointerp
This variable is used only by the asciiplot command. Normally asciiplot interpolates data onto a linear scale before plotting it. If this option is given this won't be done -- each line will correspond to one data point as generated by the simulation. Since data are already linearized unless from a transient analysis with steptype set to nousertp, setting this variable will avoid a redundant linearization.

noplotlogo
When set, the WRspice logo is not shown in plots and hard-copies.

plotgeom
This variable sets the size of subsequently created plot windows. It can be set as a string "wid hei" or as a list ( wid hei ). The wid and hei are the width and height in pixels.

For Microsoft Windows, the default (when plotgeom is unset) width and height are 500, 300 and these apply to the whole window. Due to Microsoft's silly and unnecessary conversion to ``dialog units'', the actual pixel size may be slightly different.

For others, the default width and height are 400, 300 and these apply to the plotting area only.

The acceptable numbers for the width and height are 100--2000. In the string form, a non-numeric character can separate the two numbers, e.g., "300x400" is ok.

plotposnN
This variable can be used to set the screen position of the N'th plot window. It can be specified as a list, as
set plotposn0 = ( 100 200 )
or as a string, as in
set plotposn2 = "150 250".
The N can range from 0-15. If not set, the plots are positioned by an internal algorithm.

plots
This list variable is read-only, and contains the names of the plots available. The curplot variable can be set to any of these, or to the word ``new'', in which case a new, empty plot is created.

plotstyle
This variable is used to determine the plot style in the commands plot, hardcopy, and asciiplot. Its value may be one of:

linplot Connect points with line segments
combplot Connect each point to the X-axis
pointplot Plot each point as a discrete glyph

pointchars
If this variable is set as a boolean, alpha characters will be used as glyphs for point plots (i.e., the pointplot mode is active) in a plot command. If set to a string, the characters in this string are used to plot successive data values. The default is ``oxabcdefhgijklmnpqrstuvwyz''.

pointplot
This is a keyword of the plotstyle variable, or can be set as a boolean. This will cause data to be plotted as unconnected points. Each successive expression is plotted with a different glyph to mark the points. The glyphs default to an internally generated set, however alpha characters can be used if the variable pointchars is set.

polar
This is a keyword of the gridstyle variable, or can be set as a boolean. It specifies use of a polar grid instead of a rectangular grid.

polydegree
This variable determines the degree of the polynomial that is fit to points when a plot is done. If it is not set or set to 1, then the points are connected by lines. If it is greater than 1, then a polynomial curve is fit to the points. If the value of polydegree is n, then for each n + 1 adjacent points, an nth degree curve is fit. If this is not possible (due to the fact that the points aren't monotonic), the curve is rotated 90 degrees and another attempt is made. If is is still unsuccessful, n is decreased by 1 and the process is repeated. Thus four points in the shape of a diamond may be fit with quadratics to approximate a circle (although it's not clear that this situation comes up often in circuit simulation). The variable gridsize determines the size of the grid on which the curve is fit if the data are monotonic. If the gridsize variable is zero or not set, or the scale is non-monotonic, no polynomial fitting is done.

polysteps
This variable sets the number of intermediate points to plot between each actual point used for interpolation. If not set, 10 points are used.

scaletype
This variable is used to determine the treatment of the Y-axis scaling used in displaying the curves in the plot command. Its value may be one of:

multi Use separate Y-scales for each trace (the default)
single Use common Y-scale for all traces
group Use same scale for voltages, currents, and others

single
This is a keyword of the scaletype variable, or can be set as a boolean. It indicates the use of a common Y-scale for all traces in the plot.

smith
This is a keyword of the gridstyle variable, or can be set as a boolean. It specifies use of a Smith grid instead of a rectangular or polar grid, and an implicit transformation of the data into the ``reflection coefficient'' space through the relation S = (z - 1)/(z + 1) , where z is the complex input data.

smithgrid
This is a keyword of the gridstyle variable, or can be set as a boolean. It specifies use of a Smith grid instead of a rectangular or polar grid, and plots the data directly, without transformation. The data must fall within the unit circle in the complex plane to be visible.

ticmarks
If this variable is set as a boolean, than an ``x'' will be printed every 10 points for each curve plotted. This variable may also be set as a number, which will be the number of points between each tic mark. If interpolation is used for plotting, the ticmarks feature is disabled.

title
This variable provides a string to use as the title printed in the plot. If not specified, the title is taken as the name of the current plot.

xcompress
This variable can be set to an integer value. It specifies that we plot only one out of every value points in each of the vectors.

xdelta
This value is used as the spacing between grid lines on the x-axis, if set.

xglinewidth
This variable specifies the line width in pixels to use in xgraph plots. If not set, a minimum line width is used.

xgmarkers
If set, xgraph point plots will use cross marks, otherwise big pixels are used.

xindices
This variable can be set as a list ( lower upper ) or as a string "lower upper", where lower and upper are integers. Only data points with indices between lower and upper are plotted. The value of upper must be greater or equal to lower.

xlabel
This variable provides a string to be used as the label for the x-axis. If not set, the name of the scale vector is used.

xlimit
This variable can be set as a list ( lower upper ) or as a string "lower upper", where lower and upper are reals. The plot area in the x-direction is restricted to lie between lower and upper. The area actually used may be somewhat larger to provide nicely spaced grid lines, however.

xlog
This is a keyword of the gridstyle variable, or can be set as a boolean. It specifies use of a log scale for the x-axis and a linear scale for the y-axis.

ydelta
This value is used as the spacing between grid lines on the y-axis, if set.

ylabel
This variable provides a string to be used as the label for the y-axis. If not set, no label is printed.

ylimit
This variable can be set as a list ( lower upper ) or as a string "lower upper", where lower and upper are reals. Setting this variable will limit the plot area in the y-direction to lie between lower and upper. It may be expanded slightly to allow for nicely spaced grid lines.

ylog
This is a keyword of the gridstyle variable, or can be set as a boolean. It specifies use of a log scale for the y-axis and a linear scale for the x-axis.

ysep
If this boolean is set, the traces will be provided with their own portion of the vertical axis, so as to not overlap. Otherwise, each trace may occupy the entire vertical range on the plot.


next up previous contents index
Next: Simulation Option Variables Up: Variables Previous: Command-Specific Variables   Contents   Index
Stephen R. Whiteley 2022-09-18