Copyright: WPlot, (c) Copyright 1994 William G. Hood


Contents

Introduction

Data Input & Plot Command Files

Title, Labels & Legends

Axes

Plot Types

Curve Fitting

Function Evaluation

Plot Display

Data Manipulation

Miscellaneous

Examples

Creating a BMP Bitmap File


Introduction

The WPLOT program plots X-Y data read from a data file or typed interactively at the keyboard.   Up to 250 sets of data can be plotted on the same 2-Dimensional plot using either one or two vertical axes. There can be up to 16000 data points per data set.  Each data set can be plotted as a smooth curve plot, a scatter plot, a step plot or a histogram.   Multiple data sets can also be plotted as a 3-Dimensional plot.   The plot can have linear or log axes with auto or manual scaling.   Two-Dimensional plots can also have cumulative normal probability axes, error bars and descending as well as ascending axes. Data can be fit by a smooth curve or a least squares polynomial or exponential.   The Fast Fourier Transform can be used to fit the data with a discrete Fourier series and the magnitudes of the FFT coefficients can be plotted.   An auxiliary program, WFIT, can fit a nonlinear function to data and use WPLOT to plot the fit. Mathematical transformations of the data can be performed by entering equations that operate on one or more data sets.   Functions can be evaluated and plotted.

WPLOT's plotting features can be accessed interactively from the menu interface.   However, WPLOT is actually command driven and can automatically execute a sequence of plot commands read from a command file.   A plot produced from the menu interface can be saved as a plot command file and later automatically re-drawn by loading the command file.   A plot command file could also be produced by an editor, word processor or a user written program that generates the plot commands and data as output as does the auxiliary program WFIT.

This help file shows the syntax of each plot command and how the corresponding task is selected from the menu interface.   A few of the more esoteric commands can not be selected from a menu.   These commands can be executed from a command file or typed in a command dialog box by selecting the menu item "Options | Command Box".


Command Syntax

Each command consists of a single word specifying

what task the command performs.   Most commands

are followed by one or more parameters, separated

by spaces, that affect the operation of the

command.   One common parameter is the number of

the data set that the command is to operate on.

Some commands can, optionally, operate on a range

of data sets.   A data set range is specified in

the form n-m where n and m are the first and last

data sets, respectively, in the specified range,

e.g. 3-8.   There must not be any spaces around

the dash "-"; the "-m" can be omitted when

specifying a single data set.

If a command's task is selected from a menu then

the parameters are input into a dialog box or

selected from a sub-menu.


Menu Interface

The task performed by a plot command can also be

selected from a menu (with a few exceptions).

The description of a command and its parameters

will be followed by the sequence of menu selections

that will perform that task.   If a task is selected

from a menu then the parameters are input into a

dialog box or selected from a sub-menu.


Data Input & Plot Command Files

The following command reads and executes the plot commands in the file "filename.PLT":

LOAD  filename.PLT

DO  filename.PLT    (Same as LOAD command.)

Menu:  File | Load Plot Command File

The following command saves to the file "filename.PLT" the data and plot commands that will redisplay the last displayed plot:

SAVE  filename.PLT

Menu:  File | Save Plot Command File

If the filename is omitted then it defaults to "SAVE.PLT".   If the file already exists it is overwritten.    The commands CLRPLOT, CLRDATA and CLOSE are written to the beginning of each command file created with the SAVE command.

The following commands are used to read data.

OPEN  filename    - Opens data file "filename" for read.

Menu:  File | Open Data File

READ  n    - Reads "n" X Y data pairs.

Menu:  File | Read X Y Data Pairs

If no data file is open and the READ command is in a command file then the data is read from the command file starting at the line after the READ command.

If "Read X Y Data Pairs" is selected from the menu then the data will be read from a data file if one is open; if a data file is not open then the data is entered interactively from within a Windows edit control.   Due to memory limitations of edit controls, only a limited number of data points can be input interactively, approximately 1000.

Multiple reads will result in multiple sets of data being plotted on the same plot.  If the number of data points to read is omitted then data will be read until the end of the file is reached.   Successive data values must be separated by at least one non-numeric character other than "+", "-", ".", "E" or "e".   Numbers can be in scientific notation with "E" or "e" preceding the exponent.

Data can also be read in which all of the X values precede all of the Y values:

READX  n    - Reads "n" X data values; must precede READY command.

Menu:  File | Read Other Formats | Read X Data Values

READY  n    - Reads "n" Y data values; X = 1, 2, 3 ... if no READX.

Menu:  File | Read Other Formats | Read Y Data Values

If a READY command is not preceded by a READX (or READ) command then the Y values will be plotted at even intervals.

Multiple sets of data can also be read when the data is arranged in the form of a table:

READTAB  m  n    - Reads "n" rows of a table with columns  X, Y1, Y2,..., Ym.   The X values must be in the first column and the corresponding Y values of data set #1 to data set #m must be in the remaining "m" columns.

Menu:  File | Read Other Formats | Read Table X Y1...Yn

READTABY  m  n    - Reads "n" rows of a table with columns Y1, Y2,..., Ym.   If the command is not preceded by a READX command then the Y values will be plotted at even intervals.

Menu:  File | Read Other Formats | Read Table Y1...Yn

READTAB and READTABY are not valid if other data sets have already been read.

Multiple sets of data can be plotted on a 3-Dimensional plot in which each data set corresponds to a point on the Z axis:

READZ  n       - Reads "n" Z data values for 3-D plots; there should be one Z value per data set.

Menu:  File | Read Other Formats | Read Z Data Values

A single 3-Dimensional curve can be plotted in which the points on the curve are the X-Y points in data set #1 and the corresponding Z values read with the READZ command.   There can be a maximum of 1024 points on the 3-D curve.   A table of X Y Z data values can be read with the following command:

READXYZ  n    - Reads "n" X Y Z values as single 3-D data set for plotting as a 3-D curve or 3-D scatter plot.

Menu:  File | Read Other Formats | Read X Y Z 3-D Values

READZXY  n    - Reads the 3-D data point values in the order Z X Y.

Menu:  File | Read Other Formats | Read Z X Y 3-D Values

The following are some more commands used in reading data:

CLOSE    - Closes the data file; opening a new data file will also close a previously opened data tile.

Menu:  File | Close Data File

SKIP  n    - Skips "n" lines of the data file.

Menu:  (none)

SEARCH  text    - Reads from the data file until a line containing "text" is read.

Menu:  (none)


Axes

The following plot commands specify the type of axes.   The X axis is the horizontal axis and the Y axis is the vertical axis; a 3-Dimensional plot will also have a Z axis perpendicular to the X-Y plane.   The Z axis can also be used as a second vertical axis on the right side of a 2-Dimensional plot (see USEZ command):

LINX     - Selects linear X axis (the default).

LOGX     - Selects log X axis.

PROBX    - Selects cumulative normal probability X axis.

Menu:  Axes | Set X-Axis Parameters

LINY     - Selects linear X axis (the default).

LOGY     - Selects log X axis.

PROBY    - Selects cumulative normal probability X axis.

Menu:  Axes | Set Y-Axis Parameters

LINZ     - Selects linear X axis (the default).

LOGZ     - Selects log X axis.

Menu:  Axes | Set Z-Axis Parameters

By default the program will automatically set the scales of the axes based on the minimum and maximum data values.   The scales of the axes can be set by the user with the following commands:

XSTART  value   - The X axis will start at "value".

XEND  value    - The X axis will end at "value".

XSTEP  value    - Linear X axis tic marks will be labeled in steps of "value".

Menu:  Axes | Set X-Axis Parameters

YSTART  value   - The Y axis will start at "value".

YEND  value    - The Y axis will end at "value".

YSTEP  value    - Linear Y axis tic marks will be labeled in steps of "value".

Menu:  Axes | Set Y-Axis Parameters

ZSTART  value   - The Z axis will start at "value".

ZEND  value    - The Z axis will end at "value".

ZSTEP  value    - Linear Z axis tic marks will be labeled in steps of "value".

Menu:  Axes | Set Z-Axis Parameters

Automatic scaling of an axis can be re-enabled by setting the starting and ending values equal to the same value, i.e., "XSTART 0" and "XEND 0".   If the step size is omitted from a linear axis then the program will select a step size and adjust the starting and ending values to match the step size.   The step size is ignored with a log axis.   A log axis will cover a maximum of  8 decades and will always start and end at decade boundaries.   Data plotted on a normal probability axis must be in the range .0001 to .9999; the axis will be labeled using the scaled range .01 to 99.99.

The following commands specify other axes parameters:

XDESCEND    - X axis (on 2D plots) will be labeled in descending order.

XDESCEND  OFF    - Turns off XDESCEND.

XGRID    - Grid lines will be drawn at labeled X axis tic marks.

XGRID  OFF    - Turns off display of X axis grid lines.

XBASE  value    - Vertical base line will be drawn at "value" on X axis.

XBASE  OFF    - Turns off display of X axis base line.

XTICS  n    - Selects "n" minor X axis tic marks between labeled tic marks (default is 4).

XEQUALY    - The X-Axis will be drawn so that it has the same physical length as the Y-Axis.

Menu:  Axes | Set X-Axis Parameters

YDESCEND    - Y axis (on 2D plots) will be labeled in descending order.

YDESCEND  OFF    - Turns off YDESCEND.

YGRID    - Grid lines will be drawn at labeled Y axis tic marks.

YGRID  OFF    - Turns off display of Y axis grid lines.

YBASE  value    - Horizontal base line will be drawn at "value" on Y axis.

YBASE  OFF    - Turns off display of Y axis base line.

YTICS  n    - Selects "n" minor Y axis tic marks between labeled tic marks (default is 4).

Menu:  Axes | Set Y-Axis Parameters

ZTICS  n    - Selects "n" minor Z axis tic marks between labeled tic marks (default is 4).

Menu:  Axes | Set Z-Axis Parameters

USEZ  n-m   - Data sets #n through #m will be plotted using the Z axis as a second vertical axis on right side of a 2-D plot.   The scale of the second vertical axis is set by ZSTART, ZEND & ZSTEP and the axis label is set by ZLABEL.   The  list of data sets that plot on the second vertical axis is cleared with "USEZ" (with no parameters).

Menu:  Axes | Use Z-Axis as Second Vertical Axis

CLRPLOT    - Resets plot parameters to their default values.

Menu:  Options | Reset Plot Parameters


Curve Fitting

The following commands will generate a curve fit of a data set:

POLY  m  n    - Generates an mth degree polynomial least squares fit of data set #n.

Menu:  Transformations | Polynomial Curve Fit

EXP  m  n     - Generates an exponential of an mth degree polynomial least squares fit of data set #n.

Menu:  Transformations | Polynomial Curve Fit

The exponential curve fit will be of the form:

         m        m-1

     Cm X + Cm-1 X +...+ C1 X + C0

Y = e

AVG  m  n    - Generates a nonweighted moving average smooth fit of data set #n using a moving window 2*m+1 data points wide.   The data points must be equally spaced.

Menu:  Transformations | Moving Average

If "m" is omitted from the above commands then it defaults to one; a polynomial fit's degree cannot be greater than 10.  If "n" is omitted it defaults to the last read data set.   The generated data is stored as a new data set.   The commands "POLY  m  n  X1  Y1  X2  Y2" and "EXP  m  n  X1  Y1  X2  Y2" force the fitted curve to pass through point (X1,Y1) and, optionally, through point (X2,Y2); the parameters "m" and "n" cannot be omitted.   Example: the command "POLY  2  1  0  0" fits a 2nd degree polynomial to data set #1 with the polynomial forced to pass through the origin.

If the POLY or EXP command is used again to fit the same data set with a different degree polynomial or the AVG command is used again with a different window size then the new fit will overwrite the old one. This feature can be particularly useful when doing a polynomial curve fit and it is not known what degree will give the best fit.   When selected from the menu, a polynomial fit will display a statistic, the residual variance. First try a first degree fit and note the residual variance.   Then try a second degree fit and again note the residual variance.   Then try a third degree fit, etc.   When a degree is reached in which the residual variance did not change by much from the previous value then the previous degree is the one that should be used.

KEEP    - Keeps the last generated fit from being overwritten by a new one.

Menu:  Transformations

OUTPOLY  file    - Outputs the last generated polynomial's coefficients to the specified file; if the file is omitted then the output will be to the screen.

EXPWT  m    - Exponential fits will be weighted with the Y data values raised to the mth power; m = 0,1,2.   The default is m=2.   If an exponential fit is used to fit a bell shaped curve, for example, then a closer fit of the points at the top of the peak will be made if Y squared is used as a weight. If the data is not weighted (m=0) then a closer fit of the tails of the peak will be made.

Menu:  Transformations | Polynomial Curve Fit

FFT  n    - Calculates the Fast Fourier Transform of data set #n (last data set if n is omitted).   The data must be equally spaced and the number of data points can not be greater than 8192 and should be equal to 2 raised to an integer power, i.e., 2, 4, 8, 16, 32, ... 8192; if not, then the data is padded with the smaller of the two end points.   When the data is plotted it will be fit with a truncated Fourier series by inverting the FFT; the KEEP command will save the fit as a new data set.

Menu:  Transformations | Fast Fourier Transform

PLOTFFT    - Plots the magnitudes of the FFT coefficients.

PLOTFFT2    - Plots square of magnitudes of FFT coefficients.

FFTFREQ  m    - Specifies the number of FFT frequency components used to fit the data.

FFTMAG  value    - Specifies the maximum value to be plotted on the FFT magnitude axis.

Menu:  Plot | FFT Plot

OUTFFT  file    - Outputs the FFT coefficients (corresponding to positive frequencies) to the specified file; if the file is omitted then the output will be to the screen.

READFFT  m    - Reads m complex FFT coefficients corresponding to zero frequency and m-1 positive frequencies; m-1 should equal 2 raised to an integer power.   A new data set is generated by inverting the FFT (the X coordinates will be 0, 1, 2, ...).

Menu:  (none)


Plot Types

The following commands select the type of 2-D plot for each data set:

LINE  n-m    - Selects a line plot (the default) of data sets #n through #m in which successive data points are connected by straight lines.

SPLINE  n-m    - Selects a natural cubic spline plot of data sets #n through #m in which successive data points are connected by a smooth spline curve.   NOTE:  This option is not available from a menu.

CURVE  n-m    - Selects a smooth curve plot of data sets #n through #m using a proprietary method that does not oscillate as much as a spline curve.

SYMBOLS  n-m    - Specifies that symbols are to be drawn at the data points of data sets #n through #m along with the connecting lines or curve.   See SYMTYPE command.

SCATTER  n-m    - Selects a scatter plot of data sets #n through #m with just the symbols for the data points and without the connecting lines or curve.

SPIKES  n-m     - Specifies that vertical spikes are to be drawn to the data points of data sets #n through #m along with the connecting lines or curve.

HISTOGRAM  n-m    - Selects a histogram of data sets #n through #m with the data points represented by vertical spikes and without the connecting lines or curve.

HISTWIDTH  value    - If "value" is nonzero then histograms will be plotted using bars of width "value" instead of spikes.

STEP  n-m    - Selects a step plot of data sets #n through #m with successive data points connected by horizontal steps.

Menu:  Options | Set Data's Plot Type

NOTE:  In order to make a SPLINE or CURVE plot the X values must be in ascending order.

The following command is used to plot error bars:

ERRBARS  m  n    - Data set #m will plot as upper or lower error bars of data set #n.   To have upper and lower error bars for data set #n there must be two sets of data specified as error bars.   One data set must contain lower limits and the other must contain upper limits on the corresponding Y values of data set #n; the X values of the error bar data sets should be the same as the corresponding X values of data set #n.

Menu:  Options | Error Bars

DASH  ON    - Enables dashed lines;  DASH  OFF  disables dashed lines.

Menu:  Options | Dashed Lines

SYMTYPE  k  n-m    - Specifies that symbol type "k" be used to plot data point symbols for data sets #n through #m.   "k" can be one of the following number or two-letter codes:

   1  SQ  - Square

   2  DI  - Diamond

   3  CR  - Cross

   4  CI  - Circle

   5  AD  - Arrow Down

   6  AR  - Arrow Right

   7  AU  - Arrow Up

   8  AL  - Arrow Left

   9  HG  - Hour Glass

  10  BO  - Bow

  11  DO  - Dot

The SYMTYPE command with no parameters sets all symbol types back to the default types.

Menu:  Options | Set Symbol Type


Title, Labels & Legends

The following commands are used to specify a title, axes labels and data set legends:

XLABEL  text    - The character string "text" will be displayed below the X-axis.

YLABEL  text    - The character string "text" will be displayed to the left of the Y-axis.

ZLABEL  text    - The character string "text" will be displayed to the right of the Z-axis on 3-D plots (or 2-D plots with a second vertical axis).

TITLE  text    - The character string "text" will be displayed above the plot.

Menu:  Labels | Enter Title & Labels

LEGENDn  X  Y  text    - The legend "text" associated with data set #n will be displayed at coordinate (X,Y).   The LEGENDn coordinate (X,Y) is the coordinate of the center of the left side of the first character in the text. The coordinate values are specified as fractions of axis length and are normally between  0.  and  1.,  i.e.,  (0.,0.)  is at the origin,  (1.,0.)  is at the end of the X-axis and  (0.,1.)  is at the top of the Y-axis.   The legend coordinates are screen coordinates; the legends are NOT repositioned if the origin or axes scales are changed.   LEGEND1, LEGEND2, ..., LEGEND9 are associated with data sets 1 to 9, respectively, and LEGEND0 is associated with data set 10; only the first 10 data sets can be given legends.   The legends are displayed using the same colors used to plot the corresponding data sets; if no data set corresponds to a legend then the axes color is used.   Legends are displayed on 2-D plots only.

The LEGENDn command is intended for use within a plot command file. The SAVE command will save a plot's legends as LEGENDn commands. To manually place a legend on a plot (after the plot is drawn):

 (1)  Press function key Ctrl+Fn (or select "Labels | Enter Legends" from  the menu); this calls up the legend's dialog box.

 (2)  Move the legend's dialog box to the desired position on the screen.

 (3)  Type into the dialog box the text of the legend.

 (4)  Press the ENTER key.

Legends can be temporarily disabled or cleared with the following commands:

LEGENDS  OFF    - Disables display of legends.

LEGENDS  ON     - Enables display of legends.

Menu:  Labels | Legends Enabled

LEGENDS  CLR    - Clears all legends.

Menu:  Labels | Clear Legends

If the first character in a legend is an "*" then the asterisk will actually be displayed as a data point symbol provided the corresponding data points plot as symbols (specified by the SYMBOLS or SCATTER commands) and a specific symbol type has been selected with the SYMTYPE command.


Function Syntax

A function is specified using the

following syntax:

Y(X) = expression

Y(X,Z) = expression

 or

Y(Xn) = expression  ( n = 1, 2, ... )

There must not be any spaces in the

terms Y(X), Y(X,Z) and Y(Xn).   There

can be spaces around the "equals" sign

and in the expression.


Function Evaluation

A function of a single independent variable can be graphed by entering the function in the following format:

Y(X) = function of X

Menu:  Transformations | Function Evaluation

Example:   Y(X) = 1 + 2 * EXP(-X^2) * SIN(PI*X)

The function  Y(X)  must be set equal to an expression that can contain constants, the symbol  PI,  the single independent variable X,  the operators  "+"  (addition),  "-"  (substraction),  "*"  (multiplication),  "/"  (division) and  "^"  (exponentiation) and parentheses.   The expression can also contain the following elementary functions:

 ABS(X)    Absolute Value.

 SQRT(X)   Square Root.

 EXP(X)    Exponential (e to the power of x).

 LOG(X)    Logarithm (base e).

 LOG10(X)  Logarithm (base 10).

 COS(X)    Cosine.

 SIN(X)    Sine.

 TAN(X)    Tangent.

 ACOS(X)   Arccosine.

 ASIN(X)   Arcsine.

 ATAN(X)   Arctangent.

 COSH(X)   Hyperbolic Cosine.

 SINH(X)   Hyperbolic Sine.

 TANH(X)   Hyperbolic Tangent.

 SINC(X)   Sin(X) / X.

 RND()     Random Number (between 0 and 1).

 U(X)      Unit Step Function.

 ERF(X)    Error Function.

 INVERF(X) Inverse Error Function.

 J0(X) to J6(X)  Bessel Functions of the First Kind.

A new data set will be generated by evaluating the function at even intervals of  X  between starting and ending values specified by the XSTART and XEND commands:   XSTART <= X <= XEND.   The number of sample points (which defaults to 201) can be specified with the following command:

XSAMPLES  n

Menu:  Transformations | Function Evaluation

Three dimensional data can be generated by entering a function of two independent variables in the format:

Y(X,Z) = function of (X,Z)

Menu:  Transformations | Function Evaluation

Example:   Y(X,Z) = SINC( SQRT( X*X + Z*Z ) )

The function will be evaluated at even intervals of  Z  between starting and ending values specified by the ZSTART and ZEND commands:   ZSTART <= Z <= ZEND.   The number of  Z  sample points (which defaults to 51) can be specified with the following command:

ZSAMPLES  n

Menu:  Transformations | Function Evaluation

If a function is sampled for the purpose of finding its FFT then the last end point should not be included.   The following command excludes the last end point,  i.e.,  XSTART <= X < XEND  ( and  ZSTART <= Z < ZEND):

ENDPOINT  OFF

Menu:  Transformations | Function Evaluation

A new data set can be generated from a mathematical transformation of one or more existing data sets by entering a function in the following format:

Y(Xn) = function of (Xn, Y1, Y2, ..., Yn, ..., Ym)

Menu:  Transformations | Function Evaluation

Example:   Y(X1) = (Y2-Y1)^2 / SQRT( 1 + X1 )

The  Y-variables  Y1, Y2, ..., Ym  represent the  Y-values of  m  different data sets.   The  Y-values of all data sets that appear in the expression must correspond to the same  X-values, represented by a single  X-variable  Xn.   The  X-variable specified as the function argument,  Xn,  is the only  X-variable that can appear in the expression.   The expression is evaluated at each of the  X-values in data set #n.   In the above example, the  Y-values of both data set #1 and data set #2 (represented by the variables  Y1  &  Y2 ) must correspond to the  X-values in data set #1 (represented by the variable  X1 ); this would be true, for example, if the data sets were read with the READTAB command.

Each of the three types of functions,  Y(X),  Y(X,Z),  and  Y(Xn),  can be set equal to expressions that contain intermediate variables  T1, T2, ... T9.

Example:

 T1 = 1 + X

 T2 = sin( 2 * X )

 Y(X) = 1 + T2 / T1 + ( 1 - X * T2 ) / ( T1 * T1 )

The intermediate variables are not evaluated and are not checked for errors until a function specification is used to generate a new data set; then, at each point at which the function is to be evaluated, the intermediate variables are first evaluated in the order  T1, T2, ... T9  then the function is evaluated.   Note that if an intermediate variable is defined then it will be evaluated even if it does not appear in the function's expression.   An intermediate variable can be cleared by setting it equal to nothing.   Example: T1 =

Some more commands for manipulating functions are:

INTEGRATE  n    - Generates the indefinite integral of data set #n using the trapezoidal method of numerical integration.

Menu:  Transformations | Integrate Data

DIFFER  n    - Generates the derivative of data set #n.

Menu:  Transformations | Differentiate Data


Plot Display

The following commands are used to display a plot:

PLOT    - Makes a 2-Dimensional plot.

Menu:  Plot | 2-D Plot

If the PLOT command was executed from within a command file then the program will wait until the user presses the Tab key or selects the "More" menu item before executing the next command in the file.   Selection of the "Quit" menu item will terminate execution of the command file; it does not terminate the program.

After a 2-Dimensional plot has been displayed, selection of the menu item "Options | Display Coordinates" will display the X and Y values associated with the point on the plot that is at the tip of the mouse cursor.

The following commands make 3-Dimensional plots:

PLOT3D    - Makes a 3-Dimensional plot of multiple X-Y data sets with the Z axis a parameter axis.

PLOT3D  SURFACE    - Makes a 3-Dimensional plot of multiple X-Y data sets representing curves on a surface  Y = f(X,Z).

PLOT3D  CURVE    - Makes a plot of a 3-Dimensional curve.

PLOT3D  SCATTER    - Makes a 3-Dimensional scatter plot.

Menu:  Plot | 3-D Plot

With a 3-D plot, each  X-Y  data set will correspond to a point on the Z axis.   If  Z  values were read with the READZ command then the  kth  X-Y  data set will correspond to the  kth  Z  value.   The  Z  values must be in ascending order.   If no  Z  values were read then the  X-Y  data sets will be plotted at even intervals along the Z  axis.   With a normal 3-D plot the data sets are plotted in different colors as a sequence of stacked 2-D plots.   With a surface 3-D plot all data sets are plotted with the same color using a different hidden line algorithm that allows the bottom of the surface to be visible as well as the top.

With a surface 3-D plot each data set is assumed to contain the points of a curve on the surface that corresponds to a constant value of  Z, i.e.,  Y = f(X,Zk)  where Zk is the value of Z that corresponds to the kth data set containing the  X  and  Y  values.    If all data sets contain the same sequence of  X  values (i.e., the data values are points on a rectangular grid) then the easiest way of reading the points on the surface is to use a READTAB command and a READZ command (or select the corresponding menu items):

 READTAB m n

 X1 Y11 Y12 ... Y1m

 X2 Y21 Y22 ... Y2m

 .              .

 :              :

 Xn Yn1 Yn2 ... Ynm

 READZ m

    Z1  Z2 ...  Zm

A 3-D curve is plotted as as sequence of (X,Y,Z) values in which the X-Y values were read as data set #1 using the READ command and the  Z  values were read using the READZ command.   The  (X,Y,Z)  values can also be read using the READXYZ command (or the READZXY command).

If a group of  (X,Y,Z)  values contained in data set #1 and  Z  is plotted as a 3-Dimensional scatter plot then a symbol is drawn at each data point along with a vertical line connecting the symbol to the X-Y plane.

A different view of the a 3-D plot can be specified with the following command:

ROTATE    - Next 3-D plot will be rotated 90 degrees.

ROTATE  OFF    - Next 3-D plot will be displayed using the normal view.

Menu:  Plot | 3-D Plot

The following command can be used to temporarily disable the plotting of selected data sets:

NOPLOT  n-m    - Data sets #n through #m will not be plotted on the next plot; they are not deleted and can still be manipulated.   The list of disabled data sets is cleared with the command "NOPLOT" (with no parameters).

Menu:  Options | Disable Data Sets

The last displayed plot will be redrawn if the keys CTRL+P are pressed or the right mouse button is double clicked (when cursor is in the client window).

BGCOLOR  WHITE    - Sets background color to WHITE; default is BLACK.

Menu:  Options | White Background

AXISCOLOR  k    - Specifies that color index "k" be used for drawing axes and labels.  The color index corresponds to one of the 15 color indexes (excluding 0) available with standard EGA/VGA.  The color parameter "k" can also be specified by using the first two letters of the following color names: BLue, GReen, CYan, REd, MAgenta, BRown, MGray, DGray, LBlue, LGreen, LCyan, LRed, LMagenta, YEllow, BW (Black or White - opposite of background); (L=light, M=Medium, D=Dark).

DATACOLOR  k  n-m    - Specifies that color index (or name) "k" be used for plotting data sets #n through #m.

Menu:  (none)

 A simple way of handling color is to put your choice of color commands in  a command file, COLOR.PLT for example, then put the command "LOAD COLOR.PLT"  in all other command files or load it interactively.  The AXISCOLOR or  DATACOLOR command with no parameters sets the colors back to the  default colors.


Data Manipulation

Multiple sets of plotted data that correspond to different orders of magnitude or different ranges can be compared by using the  Z  axis as a second vertical axis on the right side of a 2-D plot (see USEZ command) or by using the following commands:

SCALEX  value  n-m    - Multiplies the X values in data sets #n through #m by "value".

OFFSETX  value  n-m    - Adds "value" to the X values of data sets #n through #m.

SCALEY  value  n-m    - Multiplies the Y values in data sets #n through #m by "value".

OFFSETY  value  n-m    - Adds "value" to the Y values in data sets #n through #m.

SCALEZ  value    - Multiplies the Z values by "value".

OFFSETZ  value    - Adds "value" to the Z values.

Menu:  Transformations | Scale Data

The above commands can also be used to scale the data to keep scientific notation from being used in axes tic mark labels.

The following are some more commands for manipulating data:

CLRDATA  n-m    - Clears data sets #n through #n; clears all data sets if there is no parameter.

Menu:  File | Clear Data Sets(s)

REDUCE  m  n    - Replaces data set #n with averages of successive groups of m data points, i.e., the number of data points is reduced by a factor of 1/m.

Menu:  (none)

SWAPXY  n-m    - Swaps X and Y values of data sets #n through #m.

Menu:  Transformations | Swap X and Y

COPY  x1  x2  n    - Copies data points between  x1  and  x2  from data set #n to a new data set; "COPY  0  0  n" copies all of the data set.

Menu:  Transformations | Copy Data Set

APPEND  m  n    - Appends data set #m to the end of data set #n and deletes data set #m.

Menu:  Transformations | Append Data Set

YYTOXY  n  m    - Generates a new data set with the  X  values copied from the  Y  values of data set #n and the new  Y  values copied from the  Y  values of data set #m, i.e.,  (Yn,Ym) is copied to new (X,Y).   If a table of data is input with the READTABY command and plotting of the input data is disabled with the NOPLOT command then the YYTOXY command can be used to select any pair of columns from the table as a data set to be plotted.

Menu:  (none)

YTOZ  n    - Copies Y values of data set #n to Z data array.

Menu:  (none)


Examples

Suppose the file EXAMPLE.PLT contains the following commands and data:

title  Example Plot

xlabel  This is the X axis

ylabel  This is the Y axis

xstart  5

xend  15

xstep  2.5

ygrid

open  data2.dat

read  16

read

open  data1.dat

read

close

read  12

 6   178    7   193    7.5   212    8   243

 8.5   365    9.5   185   10     72   12   43

12.5   150    13   240    13.5   30    14   85

symbols  3

symbols  4

plot

And suppose data file DATA2.DAT contains:

 5   30    6    40    7   70    8   120

 9   250    9.5   450    10   800   10.25   900

10.5   950    10.75  880   11  700   11.5   290

12   150    13    80    14   50    15    40

 5   980     6   980    7   980    8   950

 8.5   900    9   800    9.5   500    10   400

10.5   300    11   250   11.5   220    12   200

13   200    14   200    15   200

And suppose data file DATA1.DAT contains:

 4    50     6   75    8   125    10   275

12   575    14   950

A plot will be displayed by loading the command file EXAMPLE.PLT with the LOAD command or selecting menu item "File | Load Plot Command File". The  X  and  Y  axes will be labeled and the plot will be titled. The X-axis will be linear by default and will range from 5 to 15 and be labeled in increments of 2.5.   By default the WPLOT program will set the scale of the Y-axis which will also be linear.   Horizontal grid lines will be drawn.   Four sets of data will be plotted.   The first set of data will consist of 16 data points read from file data2.dat.   The second set of data will be all of the remaining data in file data2.dat.   The third set of data will be read from file data1.dat. The fourth set of data will be the 12 data points in the command file.   All four sets of data will be plotted as line plots.   Symbols will be drawn at the data points in the third and fourth sets of data.

The data in the following command file will be plotted at even intervals on the X-axis using a log Y-axis:

title  Example Log Plot

xlabel  X

ylabel  Y

logy

ready   24

 2.1    2.9     3.3    3.8    4.6    6.2

 8.3   12.4    17.1   29.3   53.7   75.4

92.1   62.3    25.4   15.2   11.2    7.4

 5.9    4.1     3.6    2.8    2.3    1.95

plot

The following commands will produce a 3rd degree polynomial curve fit:

title  Third Degree Polynomial Curve Fit

xlabel  X

ylabel  Y

read  10

.5     3      1.5   7    2.5  12.5

5.5   14.5    6.5  16    9.5  14.5

10.5  16     12.5  16   14.5  21

15.5  23

poly  3

plot

Other examples can be found in the example command files with a PLT extension.


Miscellaneous

These commands are for use within user written plot command files:

MESSAGE  text    - Displays single line of text in client window.

Menu:  (none)

MESSAGES  n    - Displays n lines of text that follow MESSAGES command.

text line #1

text line #2

 :

text line #n

Menu:  (none)

WAIT    - Waits until user presses the Tab key or selects "More" menu item.

Menu:  (none)

*  A line in a command file that begins with an asterisk is treated as comment.


Creating a BMP Bitmap File

WPLOT does not have the capability to write a plot to a BMP bitmap file (this capability may be added in a future version).   However, a plot can still be written to a BMP file or imported into a word processor document using the Windows Clipboard and PaintBrush.   For best results follow these steps:

From the WPLOT Options sub-menu, select "White Background" and "Three-Quarter Size Plot" (there should not be any scroll bars displayed).

Hold down the "Alt" key and prress the "Print Screen" key; this copies the active window to the Clipboard including the caption and menu bar.   The Windows PaintBrush program can be used to remove the caption and menu bar from the image.

Start the Windows PaintBrush program and maximize it to make sure there is room to display the full image (from the "View" sub-menu, you may also want to disable display of the Palette bar).   Then from the "Edit" sub-menu select "Paste" to display the image.   Then select the "Scissors" tool and position the cutout box so that it encloses just the plot.

From the "Edit" sub-menu then do one of the following:

To put the cutout plot (without the caption and menu bar) back into the clipboard for direct pasting into a word processor document, select "Cut".

To save the cutout plot to a BMP file, select "Copy to".

Then, after starting the word processor, either paste the contents of the Clipboard directly into the document or import the BMP file.