, 

JPL Publication 87-3 

AKPLOT: A Plotter Routine for 

IBM PC, XT, and AT 

Ani1 Kantak 

(NASA-CR- I8O240) ALKFLCZ: A fLCPlEB ROU'IIIE N87- 15001 

€CE( IEB PC, x'1 Bhl; A1 (Jet EKG&UlSiOn Lab.) 

CSCZ 09s 

Unclas 38 P 

G3/61 43737 

February 15,1987 

NASA 

National Aeronautics and 

Space Ad ministration 

Jet Propulsion Laboratory 

California Institute of Technology 

Pasadena, California 

. 
JPL Publication 87-3 

AKPLOT: A Plotter Routine for 

IBM PC, XT, and AT 

Ani1 Kantak 

February 15,1987 

National Aeronautics and 

Space Administration 

Jet Propulsion Laboratory 

California Institute of Technology 

Pasadena, California 
The research described in this publication was carried out by the Jet Propulsion 

Laboratory, California Institute of Technology, under a contract with the National 

Aeronautics and Space Administration. 

Reference herein to any specific commercial product, process, or service by trade 

name, trademark, manufacturer, or otherwise, does not constitute or imply its 

endorsement by the United States Government or the Jet Propulsion Laboratory, 

California Institute of Technology. 
I ABSTRACT 

The AKPLOT software for the IBM PC, XT, and AT is an efficient and 1 

I versatile tool that allows X-Y plotting of quantitative information. 

allows 40 different curves on the same grid, shrink or expansion of the graph 

Features 

include IBM four-color graphics, which combined with 10 different symbols 

size, any combination of log and linear X and Y axes, selective plotting from 

multiple curves of a previous run, interpolation and polynomial least-squares 

fit with any degree polynomial, and a 90-degree tilt of the entire graph. 

These options are independent, and can be invoked individually. 

1 

I 

I 

~ 

i 

iii 
CONTENTS 

I. INTRODUCTION AND CAPABILITIES OF AKPLOT ............... 1 

3. 

4. 

5. 

6. 

7. 

8. 

9. 

10. 

11. INTERPOLATION AND LEAST-SQUARES FITTING .............. 3 

A. INTERPOLATION ........................ 3 

B. LEAST-SQUARES FITTING .................... 4 

111. DATA PREPARATION .......................... 5 

A. THE FIRST SECTION ...................... 5 

B. THE SECOND SECTION ...................... 5 

1. Generating Vectors From the Language .......... 5 

2. Generating Vectors From the Keyboard .......... 5 

3. Retrieving Previously Generated Vectors ........ 5 

C. THE THIRD SECTION ...................... 6 

IV. RUNNING THE DEMONSTRATOR PROGRAM .................. 8 

V. PRODUCING A USER-DEFINED X-Y PLOT ................. 11 

Figures 

1. The structure of AKPLOT ................... 6 

2. Data vector arrangement ................... 7 

Demonstrator program in linear scale ............. 9 

Demonstrator program in semilog scale ............ 10 

RunNo. 1 .......................... 19 

Iteration No. 1 of Run No. 1 ................. 22 

Iteration No. 2 of Run No. 1 ................. 25 

Iteration No. 3 of Run No. 1 ................. 28 

RunNo. 2 .......................... 30 

Iteration No. 1 of Run No. 2 ................. 32 

PRECEDING PAGE BLANK NOT FILMED 

V 
SECTION I 

INTRODUCTON AND CAPABILITIES OF AKPLOT 

The current explosion of literature in most fields of technology brings 

with it the need for an efficient and versatile tool to depict quantitative 

information. The displays required are usually graphs of one parameter 

plotted against another. 

A few years ago, such figures could be generated only with a mainframe 

computer or a minicomputer and whatever plotter resources the systems 

offered. Since the advent of low-cost microcomputers, almost every engineer 

or scientist has access to a 16-bit capacity c'omputer and all the software 

support of FORTRAN, PASCAL, and other such languages that are used for number 

crunching. There are still obstacles, however, to satisfying the need for an 

X-Y plot that will present research results: few routines for personal 

computers are capable of plotting, and the scientist's research time is too 

valuable to be diverted for the sake of developing a plotting routine tailored 

specifically for his needs. 

A new software for the IBM PC, XT, and AT goes a long way toward 

providing plotting capability with personal computers. This new software, 

AKPLOT, greatly increases the ability of the user to present data in graphic 

form with a minimum of effort. To take advantage of IBM color graphics, the 

software is written in the standard density graphics mode, which allows the 

use of four different colors for the plots. 

AKPLOT is completely interactive and user friendly. There is, at the 

start of every plot, an interactive session by which AKPLOT gathers the inputs 

necessary to plot the desired graph. This session makes the job of entering 

commands and parameters as painless as possible for users at all levels of 

experience. If the user makes a mistake in the input -- as, for instance, an 

error in syntax or an input in conflict with the general directives of the 

routine -- AKPLOT will prompt the user to reenter the input. 

these parameters to produce the plot on the screen. 

the routine loops back to the interactive session to allow unlimited 

alterations by changing the parameters. 

create again the X and Y points that were input at the start of the program, 

thus making the execution of the program faster. 

satisfaction, a screen dump to a printer may be performed and a hard copy 

generated. 

AKPLOT processes 

After plotting the graph, 

This loop back avoids the need to 

With the graph to the user's 

capabilities of AKPLOT include 

Four-color graphics. 

Multiple graphs on the same grid. 

A shrink or expansion of the graph size. 

Three different types of grids. 

Any combination of log and linear X and Y axes. 

Forty different curves on the same grid using ten different symbols 

and four different colors. 

Selective plotting from multiple curves of the previous run. 

Zoom in on any area, curve, or curves of the previous run. 

Interpolation of all or selected curves of the previous run. 
(10) Polynomial least-squares fit -- with any degree polynomial -- of all 

or selected curves of the previous run. 

(11) Tilt of the entire graph by 90 degrees. 

(12) Storage of plotted curves under desired titles for later reference. 

(13) Modification of a displayed plot that was stored from a previous 

date. 

These options are independent of each other and can be invoked 

individually. 

2 
SECTION I1 

INTERPOLATION AND LEAST-SQUARES FITTING 

When data points are joined by straight lines (which is the most common 

practice) to form a graph, the graph has corners; these corners are 

especially noticeable when the graph is blown up to bring out details. 

Corners can be avoided only with a great number of X,Y pairs of points. 

The number of pairs needed may not be possible, however, where the data 

are obtained from a one-shot experiment that produces too few points, or where 

the points are generated from a computer program that requires more time to 

produce the needed number than is available. 

A. INTERPOLATION 

Where the data points available are not sufficient to produce a smooth 

curve, the AKPLOT uses an interpolation technique to generate virtual X,Y 

pairs to provide interpolation between points. 

A step toward this technique is a tool named Lagrange's interpolation 

routine. This routine takes user-assigned consecutive X,Y pairs and generates 

(interpolates) values at the desired points. If interpolation between 

consecutive known points using "N + 1" points is desired, the following 

formula is used to generate the interpolated points: 

(x - xl) (x - x2) ... (x - 5) 

f(x) = f (xo 1 

(xo - xl) (xo - x2) *.a (xo - 5) 

(x - xo) (x - x2) ... (x - XN) 

(XI - xo) (x, - x2) ... (xl - $1 

+ f(Xl) ... 

where x,f(x) are the X,Y points known to the program. By judiciously 

selecting the possible N + 1 points to be used for the interpolation, AKPLOT 

provides the influence of almost N/2 points before the intended interpolated 

points and almost an equal number of points after the intended interpolated 

points. This interpolation technique does not change the original points 

supplied to the routine. 

provide a maximum number of points to interpolate a desired point, execution 

time will increase quite rapidly with an increase in the number of points 

supplied. 

points, execution time is minimized, but the resultant linear interpolation 

may not meet the user's standards. 

It should be noted that while it is desirable to 

Where only two points are supplied to interpolate the remaining 

3 
B. LEAST-SQUARES FITTING 

Fitting a curve to a set of points is somewhat different than 

interpolating points, although the processes are related. 

here is the polynomial least-squares fit. 

Gramm-Schmidt orthogonalization procedures. With N as the points in the set 

to which an M-degree polynomial (M = N) is to be fit, the desired polynomial is 

generated by the following formula: 

The method adopted 

The polynomials are generated by 

< 

The orthogonal polynomials Pm(x) are generated by the following formula: 

M 

i=O 

The coefficients ai are generated as follows: 

N 

It should be noted that if the polynomial degree becomes larger than the 

The routine does not change the original points, 

Because the newly generated 

number of points in the set, the result is simply a Mth-degree polynomial 

passing through the points. 

it only generates the new points and plots them. 

points are not saved, the routine generates them fresh each time the 

curve-fitting operation is called for. The same is true for the interpolation 

routine. The least-squares fit routine may be used also for curve smoothing. 

a i 

4 
SECTION I11 

DATA PREPARATION 

A. THE FIRST SECTION 

AKPLOT consists of three distinct sections. The first section, as shown 

in Figure 1, is the interactive session -- the initialization of the program. 

In this section, the user inputs all parameter values necessary for the plot 

routine, which is the third section of the program. 

B. THE SECOND SECTION 

There are three different methods in the second section by which X-Y data 

may be supplied to AKPLOT. These methods are described below. During 

interaction, the first request displayed concerns which of these methods the 

user requires: 

"ENTER 'COMPUTE' 'KEYBOARD' OR 'FILE' TO SUPPLY THE X AND Y VECTORS" 

1. Generating Vectors From the Language 

To produce X and Y vectors using the basic programming language, enter 

'COMPUTE' as the answer to the request above. By doing so, the second 

section, which facilitates computation of the X and Y vectors, will be 

displayed (see Figure 1). 

compute these vectors. J is the count of the number of curves in the plot; I 

is the count of the number of points in the Jth curve. Thus there is a 

total of M curves per plot and N points per curve. 

gathered by AKPLOT from the interactive session. Because the necessary 

arguments for the X and Y vectors are supplied from the interactive session, 

the user must further supply only the formulas necessary to compute the X and 

Y pair. There is sufficient space for this: either lines 2130 to 9999, or a 

little more than 5 kilobytes of memory, whichever occurs first. 

The FOR-NEXT loops started at line number 2130 

The values of M and N are 

2. Generating Vectors From the Keyboard 

X and Y vectors can also be produced by use of the 'KEYBOARD' option of 

the request. When the control reaches the appropriate place in the program, 

it will ask the user for the X and Y inputs. At that time, the user should 

input one X,Y pair at a time, each pair separated by a comma. The data will 

have the form shown in Figure 2. 

3. Retrieving Previously Generated Vectors 

To display previously generated X and Y vectors stored in a single file, 

enter 'FILE' as the response to the request. The control will then request 

the name of the file in which the user has stored the X and Y vectors. The 

response to this request will cause the control to open the named file and 

read X(I),Y(I) pair per read operation. Thus the user can create the file 

containing the pair X(I),Y(I) per row in the vector. 

as that shown in Figure 2. 

The data should appear 

5 
C. THE THIRD SECTION 

itself; the user is cautioned not to alter this part. Any tampering may 

destroy AKPLOT's ability to plot. 

The third and last secton, starting at line 10000, is the plotter routine 

Section I 

Initialization 

of AKPLOT 

Section I1 

User Input to 

compute X and Y 

Section I11 

AKPLOT Routine 

10 DEFSTR 2 

20 DIM 

30 

40 

0 

0 

0 

0 

1290 O 

2130 FOR J=1 TO M 

2140 FOR 1=1 TO N 

5000 X((J-I*N+I)= 

7000 Y((J-l*N+I)= 

9999 END 

[ 10000 PLOTTER ROUTINE 

0 

1 0 

0 

(25000 RETURN 

Figure 1. The structure of AKPLOT 
Curve tl 

Curve #2 

Curve #M 

X Vector Y Vector 

0 0 

0 0 

0 

0 

0 

0 

0 0 

X(MN-N+l) 

Io X(MN-N+2) 

Y (MN-N+l) 

Y (MN-N+2 ) 0 

0 

0 

Y(MN) 

Figure 2. Data vector arrangement 

7 
SECTION IV 

RUNNING THE DEMONSTRATOR PROGRAM 

To illustrate the capabilities of the AKPLOT routine, a demonstrator 

program is supplied. 

for plotting; the user supplies none. 

This program includes all the parameter values necessary 

The steps are: 

(1) Turn the system on. 

(2) 

(3) Load the basic compiler by keyboarding BASICA. 

(4) 

(5) 

Change directory to the one containing BASICA compiler. 

Load the plotter routine by keyboarding LOAD "A:AKPLOT". 

Run the program by keyboarding RUN. 

After running the program, a short request and response session follows. 

The first question displayed is "DO YOU WANT TO WORK WITH PLOT STORED IN A 

FILE?" Enter NO. 

Keyboard YES and press return. 

three sine waves of different amplitudes and frequencies in the linear X and Y 

scales. 

color for each curve. 

The second question is "DO YOU WANT TO RUN THE DEMO?" 

The plotter will then produce the plot of 

The plot is complete with axes titles and numbering, and a different 

After the first plot is complete, the system awaits the user's signal for 

the second plot. To continue, press RETURN. The second plot is the same 

three sine waves, but in semilog scale: the X axis is in log scale and the Y 

axis is in the linear scale. Again, the plot will be complete in three colors 

and with axes titles and numbering. This time the graph is tilted 90 degrees 

and the grid will be dense. At the end of this plot, the plotter will 

terminate the session after the user presses the RETURN key. These two 

figures are displayed in Figures 3 and 4. 

8 
z 

E 

-2 

--L) 

E 

I I I 

I I I 

25 5E 75 IEE 

X (SECONDS) 

Figure 3. Demonstrator program in linear scale 

9 
cu 

+ 

W 

d 

r) 

+ 

W 

4 

A 

VI 

CI 

z 

0 

0 

w 

VI 

X 

Y 

+ 

W 

rl 

* 

I 

Figure 4. Demonstrator program in semilog scale 

I 10 
SECTION V 

PRODUCING A USER-DEFINED X-Y PLOT 

Where the user wants to plot M curves on the same grid, each curve having 

N points, the data must be prepared in accordance with one of the methods 

described in Section 111: the data points are either computed in the AKPLOT 

program, or supplied via KEYBOARD or FILE. 

The first five steps are the same as those described in Section IV. 

After running the program, the following requests and responses follow. 

requests are tagged AKPLOT 

the request and tagged NOTE :. Finally, the user response to the request is 

tagged USER. : Many of the requests are self-explanatory. 

The 

:. Any needed explanation is given right after 

AKPLOT : DO YOU WANT TO WORK WITH PLOT STORED IN A FILE? 

AKPLOT : 

USER 

AKPLOT : 

USER 

AKPLOT : 

NOTE 

USER 

AKPLOT : 

NOTE This capability allows display of the stored output of a 

previous AKPLOT run. It should be noted that this question 

concerns a stored plot in a file; this should not be confused 

with file-stored X and Y vectors. If the user answers YES to 

this question, the program requests ENTER NAME OF THE FILE 

(the file that contains the plot). AKPLOT then displays the 

plot and allows changes. If the user answers NO to this 

question, the question and answer sequence resumes. 

DO YOU WANT TO RUN THE DEMO? 

NO. 

ENTER NUMBER OF CURVES TO BE PLOTTED : 

M. 

ENTER COMPUTE, KEYBOARD, OR FILE TO SUPPLY X AND Y VECTORS. 

The COMPUTE facility lets the user enter formulas to generate 

the X and Y vectors at the specified place (see Figure 1). 

This option requires input of these formulas before AKPLOT is 

run. The KEYBOARD option allows input of the X and Y vectors 

one at a time and separated by a comma. 

a file to supply X and Y vectors. The user may create this 

file with any compiler such as FORTRAN; 

is that the X,Y entries should be separated by at least one 

space. If the FILE option is selected, the next request is 

ENTER THE FILE NAME HOUSING X AND Y VECTORS; the request 

following this will be omitted. 

The FILE option opens 

the only requirement 

User should enter either COMPUTE, KEYBOARD, or FILE. 

ENTER NUMBER OF POINTS IN A CURVE : 

11 
USER 

AKPLOT 

NOTE 

USER 

AKPLOT 

NOTE 

USER 

AKPLOT 

NOTE 

USER 

AKPLOT 

NOTE 

USER 

N. 

ENTER XMIN,XMAX,YMIN,YMAX FOR THE PLOT : 

XMIN AND XMAX refer to the range of the X axis and similarly 

YMIN and YMAX refer to the range of the Y axis to be plotted. 

It should be noted that XMIN at the most be equal to the 

minimum of the X data vector and XMAX at the least should be 

equal to the maximum of the X data vector. There is one 

exception, however: where the data is supplied by using the 

FILE option, and where the X vector is monotonic, the user may 

supply XMIN larger than the X-vector minimum and XMAX smaller 

than the X-vector maximum. 

smaller than the minimum of the data vectors and maximum 

quantities larger than the maxima of the supplied data vector, 

the size of the resulting curve will shrink. 

By supplying minimum quantities 

Supply the minimum and the maximum of the X and Y vector. 

DO YOU WANT THE 90-DEGREE TILT ACTIVE? 

This option turns the whole plot 90 degrees. There is an 

advantage to this option: On most screens, the horizontal 

dimension is larger than the vertical dimension; hence, more 

details on the Y axis can be seen if the 90-degree tilt option 

is chosen. 

Enter either YES or NO. Depending upon this input, the next 

appropriate branch of questions will be asked. For the sake 

of this program, assume the answer is NO. 

ENTER THE X AXIS LENGTH (MAX = 250) : 

The total number of pixels available in the horizontal 

dimension of the screen is 300; of these, 250 are available 

for plotting curves. The remaining 50 are necessary for other 

purposes. This option allows the user to expand or shrink the 

X axis length of the plot. 

Enter any number between 100 and 250. Below 100 is 

permissible but not recommended. 

ENTER THE Y AXIS LENGTH (MAX = 150) : 

The total number of pixels available in the vertical dimension 

of the screen is 180; of these, 150 are available for 

plotting curves. 

purposes. 

Y axis length of the plot. 

The remaining 30 are necessary for other 

This option allows the user to expand or shrink the 

Enter any number between 100 and 150. Below 100 is 

permissible but not recommended. 

12 
AKPLOT : 

NOTE 

USER 

AKPLOT : 

NOTE 

USER 

AKPLOT : 

NOTE 

USER 

AKPLOT : 

NOTE 

ENTER THE GRID STYLING SELECTED : 

There are three grid styles possible. These are given below. 

User entry Grid style 

0 No grid 

1 

2 

Less dense 

Dense 

Enter either 0, 1, or 2. 

ENTER NUMBER OF MAJOR DIVISIONS ON X AXIS (0 IF LOG SCALE) : 

This option lets the user select either LINEAR scale or LOG 

scale for the X axis. If LINEAR is needed, enter the number 

of divisions desired on the X axis. If LOG is needed, enter 

0. Entering 0 automatically subdivides the X axis for the LOG 

scale. CAUTION: the number of divisions should be less than 

or equal to 5; otherwise, axis numbering may overlap. 

Any number i 5 including 0. 

ENTER NUMBER OF MAJOR DIVISIONS ON Y AXIS (0 IF LOG SCALE) : 

- 

Same as for the X axis above. 

Any number 5 5. - 

DO YOU WANT INTERPOLATION? 

This option permits the user to interpolate between the given 

points by the Lagrange interpolation technique. 

that to use interpolation, the X axis data points should be in 

monotonically increasing or decreasing order. Generally, the 

X-axis points are monotonic in nature. An exception to this 

general rule is the phase plane plots obtained in control 

systems where the X and Y points are not monotonic in nature. 

In such cases, the plotter routine may not interpolate, but it 

will still plot whatever points are given to it. It should 

also be noted that for values of X and Y below 

interpolation is not recommended because the errors inherent 

in rounding off may give wrong answers and hence a wrong plot. 

Please note 

USER User should enter either YES or NO. For the sake of 

completeness, we assume the answer is YES. 

AKPLOT : ENTER 1 FOR THE CURVE TO BE INTERPOLATED; ENTER 0 FOR EACH 

CURVE NOT INTERPOLATED: 

NOTE This option permits the user to interpolate selected curves 

from the total of M curves. The X and Y vectors for the 

curves are entered in a particular order as described in the 

data preparation section. Enter 1 for the curve(s) to be 

13 
USER 

AKPLOT 

NOTE 

USER 

AKPLOT 

NOTE 

USER 

AKPLOT 

NOTE 

USER 

AKPLOT 

interpolated and 0 for the curve(s) to be untouched. Enter 1s 

and Os in the same order as the data for the curves. 

Enter Is and Os as desired. In all there will be M inputs. 

ENTER THE NUMBER OF DATA POINTS USED IN INTERPOLATION: 

This is to set up the number of data points the user wants to 

employ to compute the interpolated points. The maximum number 

is obviously the dimension of X or Y. It should be remembered 

that interpolation slows the plotting routine considerably; 

consequently, a number less than 10 is recommended as the input. 

Input a number less than 10. 

ENTER THE NUMBER OF POINTS TO BE INTERPOLATED BETWEEN TWO DATA 

POINTS. 

This entry tells the plotter routine how many points will be 

created between two consecutive data points. Here too, a 

small number from 2 to 5 is recommended so that the program 

does not slow down. 

Input any number between 2 and 5. 

ENTER INDEX VALUES ONE AT A TIME FOR EACH CURVE. 

Index values pertain to the symbol substituted for the 

points. There are ten possibilities: 

Index 

0 

1 

2 

3 

4 

5 

6 

7 

8 

9 

Symbol 

Connect points 

with lines 

+ 

.. 

O 

X 

.. 

.. 

.. 

Select any number from 0 to 9. 

LEAST-SQUARES FIT MAY BE APPLIED TO ONLY THE ORIGINAL, 

UNINTERPOLATED POINTS. 

DO YOU WANT POLYNOMIAL LEAST-SQUARES FIT? 

14 
AKPLOT : 

NOTE 

This capability of AKPLOT lets the user perform least-squares 

fitting of the given data points with a polynomial of any 

degree less than 100. When using this option, it is advisable 

to specify the YMIN and YMAX in the XMIN,XMAX,YMIN,YMAX entry 

described above such that YMIN is less than the minimum of the 

Y vector by about 10% and YMAX is more than the maximum of the 

Y vector by 10%. 

routine generates new Y coordinates for the same X coordinates 

and hence the newly generated Y coordinate of the end points 

of the curve may not fit inside the square specified by the 

XMIN,XMAX,YMIN,YMAX. 

This is desirable because the curve-fitting 

ENTER THE X-AXIS TITLE : 

Once the title is keyboarded, the program will compare the 

length of the axis with that of the title. If the title is 

too long for the axis, a message appears prompting the user to 

reenter a shorter title. 

I USER Type in the X-axis title for the plot. 

I AKPLOT : ENTER THE Y-AXIS TITLE : 

t NOTE Same as for the X-axis title. 

USER Type in the Y-axis title for the plot. 

AKPLOT : PLEASE WAIT, COMPUTATIONS ARE IN PROGRESS ::: 

This marks the end of user inputs; AKPLOT has all the information 

necessary to produce the plot. The software now goes through compatibility 

particular input is displayed. 

I computations. Where there is an inconsistency, a prompt to reenter a 

At the end of plotting, the control will wait for the next instruction. 

If the plot is satisfactory, the screen should be dumped to a printer. 

Dumping procedures vary, and the user should consult the manual that came with 

the system. 

After dumping, push the RETURN and the program will print out the 

XMIN,XMAX,YMIN,YMAX, the X-axis graduation distance named DELX, and the Y-axis 

graduation distance named DELY. Subsequently, the program control will ask 

the following questions: 

AKPLOT : DO YOU WANT TO SAVE THE PLOT IN A FILE? 

USER YES. 

AKPLOT : ENTER THE NAME OF FILE TO STORE THE PLOT. 

NOTE Here the user may input any path to a file ("PICTURE") in any 

directory. AKPLOT will create this file and store the plot in 

it. 

15 
USER Name. 

AKPLOT : DO YOU WISH TO CHANGE ANY PARAMETERS OF THE PLOT? 

NOTE This question is an opportunity to change the plot. If a 

change is needed, answer YES. If the answer is NO, the 

plotter session will be terminated. 

USER Answer either YES or NO. 

Answering YES prompts another question and answer session. This session 

is similar to the one we just described, but here the parameter values of the 

previous run are displayed to facilitate the changes. The only new question 

in this session is described below. 

AKPLOT 

NOTE 

USER 

AKPLOT 

NOTE 

AKPLOT 

NOTE 

USER 

AKPLOT 

NOTE 

USER 

DO YOU WANT TO PLOT A PORTION OF THE CURVES? 

This option lets the user blow up any particular section of 

the previous plot. 

YES. 

THE FOLLOWING CURVES WERE DEPICTED IN THE PREVIOUS RUN. 

There are M curves given in the X and Y data vectors. 

the first position of the column of M entries means that the 

first curve was plotted; A 0 in the first position means that 

the first curve was not plotted. This is done for all the M 

curves. The numbering of the curve is the same as the 

position of the data points for that particular curve in the X 

and Y vectors (this was described in Figure 2). 

A 1 in 

ENTER 0 FOR THE CURVE YOU DO NOT WANT FROM THE M CURVES AND 

ENTER 1 FOR THE CURVES YOU WANT FOR THIS RUN : 

As explained in the NOTE above, the user can plot selected 

curves from the M curves present in the supplied X and Y 

data-point vectors. 

Supply the M zeroes and ones. 

LOWER X COORDINATE FOR THE PREVIOUS RUN : 

UPPER X COORDINATE FOR THE PREVIOUS RUN : 

ENTER THE LOWER X COORDINATE FOR THIS RUN : 

ENTER THE UPPER X COORDINATE FOR THIS RUN : 

Here the section of the curves the user wants enlarged is 

sought. Note that only the curve tagged with a 1 in the 

previous question will be plotted for the current run. 

Enter the appropriate X coordinates. 

16 
When all the questions are completed, AKPLOT will plot the new plot and 

store it in the file "PICTURE" as before; the question and answer session can 

be entered again. This simple procedure lets the user manipulate the plots to 

fit his needs. 

I The diagnostics associated with AKPLOT check every step to verify that 

the user input is not inconsistent with other inputs or the AKPLOT. When an 

inconsistency is found, the user is alerted and given the opportunity to 

change the input. 

NOTE 

This program can be obtained from NASA's Computer 

Software Management and Information Center (COSMIC) at 

University of Georgia 

Athens, Georgia 30602 

or telephoning (404) 542-3205. Ask for AKPLOT NPO 

16931. 

The documentation and the program are free to NASA 

employees; for others, there is a charge of $15.00 for 

the documentation and $200 for the program. 

The following pages illustrate the use of AKPLOT. 
Run No. 1 

DO YOU WANT TO WORK WITH PLOT STORED IN A FILE? :NO 

DO YOU WANT TO RUN THE DEMO? 

DEFAULT = (RETURN) = NO : NO 

ENTER NUMBER OF CURVES TO BE PLOTTED 

DEFAULT = (RETURN) = 1 : 3 

ENTER "COMPUTE", "KEYBOARD" OR "FILE" TO SUPPLY THE X AND Y VECTORS : C 

ENTER NUMBER OF POINTS PER CURVE : 100 

ENTER XMIN,XMAX,YMIN,YMAX FOR THE PLOT : 0,100, -4,4 

DO YOU WANT THE 90 DEGREE TILT ACTIVE? : 

DEFAULT = (RETURN) = NO : NO 

ENTER THE X AXIS LENGTH (MAX = 250) 

DEFAULT = (RETURN) = 250 : 250 

ENTER THE Y AXIS LENGTH (MAX = 150) 

DEFAULT = (RETURN) = 150 : 150 

ENTER THE GRID STYLING SELECTED 

DEFAULT = (RETURN) = 0 : 2 

ENTER NUMBER OF MAJOR DIVISIONS ON X AXIS (0 IF LOG SCALE) : 4 

ENTER NUMBER OF MAJOR DIVISIONS ON Y AXIS (0 IF LOG SCALE) : 4 

DO YOU WANT INTERPOLATION? 

DEFAULT = (RETURN) = NO : NO 

ENTER INDEX VALUES ONE AT A TIME : 

?2 

?3 

?4 

LEAST SQUARES FIT MAY ONLY BE APPLIED TO THE ORIGINAL UN-INTERPOLATED POINTS 

DO YOU WANT POLYNOMIAL LEAST SQUARES FIT? :NO 

ENTER THE X AXIS TITLE : TIME (SECONDS) 

ENTER THE Y AXIS TITLE : RESPONSE (VOLTS) 

(See Figure 5.) 

18 
E 

1 I 1 

0: 0 

0 eo i 

.............0.. 0: \.......~........~.................... 0'0 - 

0. 4 4- 

-m ...- ....... \.. . 

D4 

I 0 i #-fb40 i = 

4O 44 : -: 43 %i 0 

44 OB+ i 8 

a; 

4- 

4 :O :4 

: 8. -4 . 

:a 9 

........................... 0 : 0*4-:. I 0 

....... 6" .... a ................ -- w &:. .*.. - 

I I I 

25 5E 75 108 

TIME t SECONDS > 

Figure 5. Run No. 1 

19 
1 Iteration No. 1 of Run No. 1 

o CONTINUATION OF THE PREVIOUS EXAMPLE. 

XMAX = 100 XMIN = 0 

YMAX = 4 YMIN = -4 

DELX = 25 

DELY = 2 

DO YOU WANT TO SAVE THE PLOT IN A FILE? :YES 

ENTER THE NAME OF FILE TO STORE THE PLOT : XXX.DAT 

I DO YOU WISH TO CHANGE ANY OF THE PARAMETERS? :YES 

DO YOU WANT THE REVERSE AXIS ORIENTATION FOR THIS RUN? : YES 

DO YOU WANT TO CHANGE LENGTHS OF AXES? :YES 

LENGTH OF THE X AXIS FOR THE PREVIOUS RUN : 150 

ENTER THE LENGTH OF X AXIS FOR THIS RUN (MAX = 150) : 150 

LENGTH OF THE Y AXIS FOR THE PREVIOUS RUN : 250 

ENTER THE LENGTH OF Y AXIS FOR THIS RUN (MAX = 250) : 250 

DO YOU WANT TO PLOT A PORTION OF THE CURVES? : 

THIS OPTION IS AVAILABLE ONLY FOR MONOTONIC AND SAME X POINTS FOR ALL 

CURVES : NO 

INTERPOLATION MAY ONLY BE USED FOR MONOTONIC X POINTS : 

DO YOU WANT TO CHANGE INTERPOLATION STATUS? : NO 

LEAST SQUARES FIT MAY ONLY BE APPLIED TO THE ORIGINAL UN-INTERPOLATED 

POINTS 

DO YOU WANT A CHANGE IN POLYNOMIAL LEAST SQUARES FIT STATUS? : NO 

DO YOU WANT TO CHANGE SCALE? : NO 

DO YOU WANT TO CHANGE X AND Y LIMITS? : NO 

DO YOU WANT TO CHANGE THE GRID STYLE? : YES 

THE GRID STYLE OF PREVIOUS RUN : 2 
DO YOU WANT TO CHANGE THE INDEX VECTOR? : YES 

THE CURVE INDICES FOR THE PREVIOUS RUN : 

2 

3 

4 

INPUT THE INDICES FOR THIS RUN ONE BY ONE : 

?5 

?6 

?7 

DO YOU WANT TO PLOT X-Y VECTORS STORED IN ANOTHER FILE ON THE SAME 

GRID? : NO 

(See Figure 6. ) 

21 
-.. .... 

I...... 

.. 

8 

rn 

.. 

CL 

. -9 

-0 

..... 48 

0. 

..... 9- 

. 0- 

m. 8.* 

0 

I 

0 

c 

... .. 

N E N 

I 

C5110h) 35NOd53U 

Figure 6. Iteration No. 1 of Run No. 1 

22 
Iteration No. 2 of Run No. 1 

o CONTINUATION OF THE PREVIOUS EXAMPLE. 

YMAX = 4 YMIN = -4 

DELX = 25 

DELY = 2 

DO YOU WANT TO SAVE THE PLOT IN A FILE? : YES 

ENTER THE NAME OF FILE TO STORE THE PLOT : XXX.DAT 

DO YOU WISH TO CHANGE ANY OF THE PARAMETERS? : YES 

REVERSE AXES ORIENTATION WAS SELECTED FOR THE PREVIOUS RUN : 

DO YOU WANT THE REVERSE AXIS ORIENTATION FOR THIS RUN? : NO 

DO YOU WANT TO CHANGE LENGTHS OF AXES? : YES 

LENGTH OF THE X AXIS FOR THE PREVIOUS RUN : 150 

ENTER THE LENGTH OF X AXIS FOR THIS RUN (MAX = 250) : 250 

LENGTH OF THE Y AXIS FOR THE PREVIOUS RUN : 2 50 

ENTER THE LENGTH OF Y AXIS FOR THIS RUN (MAX = 150) : 150 

DO YOU WANT TO PLOT A PORTION OF THE CURVES? : 

THIS OPTION IS AVAILABLE ONLY FOR MONOTONIC AND SAME X POINTS FOR ALL 

CURVES : YES 

FOLLOWING CURVES WERE DEPICTED IN THE PREVIOUS RUN : 

ENTER 0 FOR THE CURVE YOU DO NOT WANT OUT OF M CURVES 

AND ENTER 1 FOR THE CURVE YOU WANT FOR THIS RUN : 

?1 

?O 

?1 

LOWER X CO-ORDINATE FOR THE PREVIOUS RUN : 1 

UPPER X CO-ORDINATE FOR THE PREVIOUS RUN : 100 

23 
ENTER THE LOWER X CO-ORDINATE FOR THIS RUN : 1 

ENTER THE UPPER X CO-ORDINATE FOR THIS RUN : 100 

INTERPOLATION MAY ONLY BE USED FOR MONOTONIC X POINTS : 

DO YOU WANT TO CHANGE INTERPOLATION STATUS? : NO 

LEAST SQUARES FIT MAY ONLY BE APPLIED TO THE ORIGINAL UN-INTERPOLATED 

POINTS 

DO YOU WANT A CHANGE IN POLYNOMIAL LEAST SQUARES FIT STATUS? : NO 

DO YOU WANT TO CHANGE SCALE? : YES 

ENTER MAJOR DIVISIONS FOR X AXIS (0 FOR LOG) FOR THIS RUN : 0 

ENTER MAJOR DIVISIONS FOR Y AXIS (0 FOR LOG) FOR THIS RUN : 4 

DO YOU WANT TO CHANGE X AND Y LIMITS? : YES 

XMIN AND XMAX OF THE PREVIOUS RUN : 0 , 100 

YMIN AND YMAX OF THE PREVIOUS RUN : -4 , 4 

ENTER NEW XMIN AND XMAX IN 1EN FORMAT : 1,100 

ENTER YMIN AND YMAX FOR THIS RUN : -4.4 

DO YOU WANT TO CHANGE THE GRID STYLE? : YES 

THE GRID STYLE OF PREVIOUS RUN : 1 

ENTER NEW STYLE : 2 

DO YOU WANT TO CHANGE THE INDEX VECTOR? : NO 

DO YOU WANT TO PLOT X-Y VECTORS STORED IN ANOTHER FILE ON THE SAME GRID? : 

NO 

(See Figure 7.) 

24 
I I I I1111 I I I I I1 

-.... 

I.... 

-.... 

I I I I1111 1 I I I II 

lE+ E lE+ i 

TIME C SECONDS 1 

lE+ 2 

Figure 7. Iteration No. 2 of Run No. 1 

25 
Iteration No. 3 of Run No. 1 

o CONTINUATION OF THE PREVIOUS EXAMPLE. 

XMAX = 100 XMIN = 1 

YMAX = 4 YMIN = -4 

DELY = 2 

DO YOU WANT TO SAVE THE PLOT IN A FILE? : YES 

ENTER THE NAME OF FILE TO STORE THE PLOT : XXX.DAT 

DO YOU WISH TO CHANGE ANY OF THE PARAMETERS? : YES 

DO YOU WANT THE REVERSE AXIS ORIENTATION FOR THIS RUN? : NO 

DO YOU WANT TO CHANGE LENGTHS OF AXES? : NO 

DO YOU WANT TO PLOT A PORTION OF THE CURVES? : 

THIS OPTION IS AVAILABLE ONLY FOR MONOTONIC AND SAME X POINTS FOR ALL 

CURVES : YES 

FOLLOWING CURVES WERE DEPICTED IN THE PREVIOUS RUN : 

1 

0 

1 

ENTER 0 FOR THE CURVE YOU DO NOT WANT OUT OF M CURVES 

AND ENTER 1 FOR THE CURVE YOU WANT FOR THIS RUN : 

?1 

?1 

?1 

LOWER X CO-ORDINATE FOR THE PREVIOUS RUN : 1 

UPPER X CO-ORDINATE FOR THE PREVIOUS RUN : 100 

ENTER THE LOWER X CO-ORDINATE FOR THIS RUN : 25 

ENTER THE UPPER X CO-ORDINATE FOR THIS RUN 50 

DO YOU WANT TO CHANGE INTERPOLATION STATUS : YES 

INTERPOLATED CURVES FOR THE PREVIOUS RUN : 

0 

0 

0 

26 
ENTER 1 FOR THE CURVES YOU WANT TO INTERPOLATE, 

OTHERWISE ENTER 0 FOR THIS RUN (ENTER ONE BY ONE) : 

?1 

?1 

?1 

NUMBER OF POINTS FOR INTERPOLATION FOR THIS RUN : 10 

NUMBER OF INTERPOLATED PTS BETWEEN TWO POINTS FOR THIS RUN : 4 

LEAST SQUARES FIT MAY ONLY BE APPLIED TO THE ORIGNAL UN-INTERPOLATED 

POINTS 

DO YOU WANT A CHANGE IN POLYNOMIAL LEAST SQUARES FIT STATUS? : NO 

DO YOU WANT TO CHANGE SCALE? : YES 

MAJOR DIVISIONS FOR X AXIS (0 FOR LOG) FOR THE PREVIOUS RUN : 0 

MAJOR DIVISIONS FOR Y AXIS (0 FOR LOG) FOR THE PREVIOUS RUN : 4 

ENTER MAJOR DIVISIONS FOR X AXIS (0 FOR LOG) FOR THIS RUN : 5 

ENTER MAJOR DIVISIONS FOR Y AXIS (0 FOR LOG) FOR THIS RUN : 4 

DO YOU WANT TO CHANGE X AND Y LIMITS? : YES 

XMIN AND XMAX OF THE PREVIOUS RUN : 1 , 100 

YMIN AND YMAX OF THE PREVIOUS RUN : -4 , 4 

ENTER XMIN AND XMAX FOR THIS RUN : 25,50 

ENTER YMIN AND YMAX FOR THIS RUN : -4,4 

DO YOU WANT TO CHANGE THE GRID STYLE? : NO 

DO YOU WANT TO CHANGE THE INDEX VECTOR? : NO 

GRID? : NO 

DO YOU WANT TO PLOT X-Y VECTORS STORED IN ANOTHER FILE ON THE SAME 

(See Figure 8.) 

27 
r) 

n 

Y 

I I I I I 111 

m...................... ..... 

-- 

-----k- 1 ............................ r-- ........... 

lE+ 1 lE+ 2 

TIME I SECONDS 1 

Figure 8. Iteration No. 3 of Run No. 1 

28 
Run No. 2 

DO YOU WANT TO WORK WITH PLOT STORED IN A FILE? : NO 

DO YOU WANT TO RUN THE DEMO? 

DEFAULT = (RETURN) = NO : NO 

ENTER NUMBER OF CURVES TO BE PLOTTED 

DEFAULT = (RETURN) = NO : NO 

ENTER NUMBER OF CURVES TO BE PLOTTED 

DEFAULT = (RETURN) = 1 : 2 

ENTER "COMPUTE", "KEYBOARD" OR "FILE" TO SUPPLY THE X AND Y VECTORS : C 

ENTER NUMBER OF POINTS PER CURVE : 100 

ENTER XMIN,XMAX,YMIN,YMAX FOR THE PLOT : 0,100,0,2 

DO YOU WANT THE 90 DEGREE TILT ACTIVE? : 

DEFAULT = (RETURN) = NO : NO 

ENTER THE X AXIS LENGTH (MAX = 250) 

DEFAULT = (RETURN) = 250 : 250 

ENTER THE Y AXIS LENGTH (MAX = 150) 

DEFAULT = (RETURN) = 150 : 150 

ENTER THE GRID STYLING SELECTED 

DEFAULT = (RETURN) = 0 : 0 

ENTER NUMBER OF MAJOR DIVISIONS ON X AXIS (0 IF LOG SCALE) : 4 

ENTER NUMBER OF MAJOR DIVISIONS ON Y AXIS (0 IF LOG SCALE) : 4 

DO YOU WANT INTERPOLATION? 

DEFAULT = (RETURN) = NO : NO 

ENTER INDEX VALUES ONE AT A TIME : 

?1 

?1 

LEAST SQUARES FIT MAY ONLY BE APPLIED TO THE ORIGINAL UN-INTERPOLATED POINTS 

DO YOU WANT POLYNOMIAL LEAST SQUARES FIT? : NO 

ENTER THE X AXIS TITLE : TIME (SECONDS) 

ENTER THE Y AXIS TITLE : OUTPUT (VOLTS) 

(See Figure 9. ) 

29 
6 

E 

B 25 50 75 IBE 

TIME I SECONDS > 

Figure 9. Run No. 2 

30 
Iteration No. 1 of Run No. 2 

o CONTINUATION OF THE PREVIOUS EXAMPLE 

XMAX = 100 XMIN = 0 

YMAX = 2 YMIN = 0 

DELX = 25 

DELY = .5 

DO YOU WANT TO SAVE THE PLOT IN A FILE? : NO 

DO YOU WISH TO CHANGE ANY OF THE PARAMETERS? : YES 

DO YOU WANT THE REVERSE AXIS ORIENTATION FOR THIS RUN? : NO 

DO YOU WANT TO CHANGE LENGTHS OF AXES? : NO 

DO YOU WANT TO PLOT A PORTION OF THE CURVES? : 

THIS OPTION IS AVAILABLE ONLY FOR MONOTONIC AND SAME X POINTS FOR ALL 

CURVES : NO 

INTERPOLATION MAY ONLY BE USED FOR MONOTONIC X POINTS : 

DO YOU WANT TO CHANGE INTERPOLATION STATUS? : NO 

LEAST SQUARES FIT MAY ONLY BE APPLIED TO THE ORIGINAL UN-INTERPOLATED 

POINTS 

DO YOU WANT A CHANGE IN POLYNOMIAL LEAST SQUARES FIT STATUS? : YES 

ENTER THE DEGREE OF POLYNOMIAL FOR THE LEAST SQUARES FIT : 2 

ENTER 1 FOR THE CURVE TO BE LEAST SQUARES FITTED OTHERWISE ENTER 0: 

?1 

?1 

DO YOU WANT TO CHANGE SCALE? : NO 

DO YOU WANT TO CHANGE X AND Y LIMITS? : NO 

DO YOU WANT TO CHANGE THE GRID STYLE? : NO 

DO YOU WANT TO CHANGE THE INDEX VECTOR? : NO 

DO YOU WANT TO PLOT X-Y VECTORS STORED IN ANOTHER FILE ON THE SAME 

GRID? : NO 

(See Figure 10. ) 

31 
6 

qm 5 

3 

lm 5 

E 

0 

1 I I I 

32 
TECHNICAL REPORT STANDARD TITLE PAGE 

1. Report No. 

4. Title and Subtitle 

2. Gowrnmont Accession No. 

JPL Pub. 87-3 

3. Recipient's Catalog No. 

5. Report Date 

7. Author(s) 

9. Performing Organization Name and Address 

JET PROPULSION LABORATORY 

California Institute of Technology 

4800 Oak Grove Drive 

Pasadena, California 91109 

8. Performing Organization Report No 

IO. Work Unit No. 

11. Contract or Grant No. 

13. Type of Report and Period Covered 

19. Security Clasrif. (of this report) 20. Security Classif. (of this page) 21. No. of Paga 

Unc las s if ied Unclassified 32 

12. Sponsoring Agency Name and Address JPL Publication 

22. Price 

14. Sponsoring Agency Code NATIONAL AERONAUTICS AND SPACE ADMINISTRATION 

Washington, D.C. 20546 I 

15. Supplementary Notes 

~~ 

16. Abstract 

The AKPLOT software for the IBM PC, XT, and AT is an efficient and versatile tool 

that allows X-Y plotting of quantitative information. Features include IBM four-color 

graphics, which combined with 10 different symbols allows 40 different curves on the 

same grid, shrink or expansion of the graph size, any combination of log and linear 

X and Y axes, selective plotting from multiple curves of a previous run, interpolation 

and polynomial least-squares fit with any degree polynomial, and a 90-degree tilt of 

the entire graph. These options are independent, and can be invoked individually. 

17. Key Words (Selected by Authw(s)) 18. Distribution Statement 

Engineering (General) 

Computer Programing and Software Unclassified - Unlimited