Plotting Your Data - HP 7470A Interfacing And Programming Manual

Graphic plotter
Hide thumbs Also See for HP 7470A:
Table of Contents

Advertisement

)
'
plotting without a pen until it encounters an SP command. You can
)
lessen the manual intervention by storing the pen using SPO as the last
HP-GL instruction before any pause, and by issuing a pen select
)
command as the first HP-GL instruction after the pause.
)
Program lines to pause, change pens, and title the graph using a wide
pen follow. Remember when you run the complete program to remove
the old pens and load wide pens directly into the left and right stalls
_)
when the message appears. The SPl command here, the first command
after the program pause, assures that the pen holder is loaded so all
subsequent lines will be drawn.
)
)
200 PRINT "SPO;"
)
210 DISP "CHANGE TO WIDE PENS"
220 PRUSE
\
230 DISP " "
240 PRINT "SP1 P R 6 , 1 5 0 s i . 4 , . 6 C P - 9 . 5 , 2 . 0 "
)
250 PRINT " L B 1 9 8 1 SHLES BY REGIONS."
"')
Plotting Your Data
'
We are now ready to draw lines. Each of the four data lines on this
)
graph is drawn using a different technique. The first two lines are
drawn by plot commands with parameters included when the program
>
was written. Hence, if the data changes, it will be necessary to change
\
the plot commands in the program.
\
The first line (the bottom-most line on the graph) is drawn with pen 1
using a dashed line type. The program takes full advantage of the
,)
plotter's relatively free syntax and uses spaces to delineate parameters.
Send the character strings to the plotter exactly as shown. Be sure to
enter those spaces; if the spaces are removed, the plotter will try to plot
)
)
one very large number and you won't plot the line.
j
After drawing the line, the pen moves to the legend area below the
graph title and draws a short line. The PU command causes the line
>
type pattern to begin again at the beginning of this line.
,)
The second line is also plotted using plot commands with fixed parame­
ters. These plot commands use the stricter syntax of the 9872 or 7225
plotters and would be accepted by any HP plotter programmed in
)
HP-GL. The line type used consists of long and short dashes; the line is
drawn with pen 2. After the data are plotted, the corresponding line is
drawn in the legend.
)
. )
)
. )
6 PUTTING THE COMMANDS TO WORK
)
)
The program lines which plot the two lower lines and the correspond­
ing legend lines are:
260 PRINT "SP1;LT3,G;Pfl1 23PD2 25 3 18 4 22 5 23"
270 PRINT "PD6 2? 7 27 8 25 9 24 10 28 11 27 12 27PU"
280 PRINT "PR7.8,185 PD9.3,165 PU"
290 PRINT "SP2;LT6,8;PR1 , 45;PD;PR2,50,3,52,4,53,5,52"
300 PRINT "PD6,51,7,55,8,56,9,56,10,58,11,58,12,60PU"
310 PRINT "PR10.1,165 PD11.e,165 PU"
The third line is plotted from data read by the program at execution
time using a FOR...NEXT loop and a READ statement. This technique
would be used to plot a graph t h a t will be replotted often with new
data. If the necessary file statements were added, the data could be on
a tape or disk file instead of in a DATA statement as shown here. The
line type for this line is the default solid line, reverted to by the LT
command with no parameters. Since we are using variables as plot
parameters, you need to be sure they are sent to the plotter with a space
between numeric variables. Computers often send a leading and/or
trailing blank or allow for a sign space before numeric variables. The
7470 will treat a blank, comma, or sign as a separator between numeric
parameters. Know your computer before sending variables with plot
commands. As with the two previously drawn lines, after the line is
plotted, the corresponding line is placed in the legend.
The loop to plot this third line and the statements to place a line in the
legend are:
320 PRINT "LT"
330 FOR X-1 TO 12
340 RERD Y
350 PRINT "PR";X;Y;"PD"
380 NEXT X
370 PRINT "PU6,165PD7. 1 , 165PU"
410 DRTR 55,60,63,62,59,54,50,46,47,49,53,58
The last line is drawn using a subroutine. The subroutine is designed to
read data that have been stored with a third value for pen control. This
third value controls a branch to two different plot statements, one with
the pen up and the other with the pen down. In this program, a zero as
a pen control parameter results in a pen up move, a 1 causes plotting
with the pen down, and 3 signifies the end of the data. The legend line
is drawn at the end of the subroutine, completing the graph.
PUTTING THE COMMANDS TO WORK 8-7

Advertisement

Table of Contents
loading

Table of Contents