Adding Color And Emphasis - HP 7470A Interfacing And Programming Manual

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

Advertisement

)
)
)
)
>
)
The loop to draw the axis and the statements to set character and tick
length and to label and title the X-axis are:
50 PRINT
" S I . 2 , . 3 ; T L 1 . 5 , 0 "
60 FOR X - 1 TO 12
70 PRINT " P R " ; X , " , 0 ;
X T ; "
80 READ R$
90 PRINT " C P - . 3 3 , - 1 ; LB" ; R * ; ' " * "
100 NEXT X
110 PRINT " P R 6 . 5 , 0 ; C P - 7 , - 2 . 5 ;
LBCRLENBflR MONTHV'
400 DRTR " J " , " F" , " H" , " R" , " M" , " J " , " J " , " R" , " S" , " 0" , " N" , " D"
The Y-axis is created in a similar manner, except the loop's index is
used for the label value and two different CP commands are used for
labels of three digits and labels of less than three digits. The Y-axis title
is centered above the axis.
Following the axis routine is the command which labels the regions for
the legend. It is drawn now while the label size is small and the narrow
pen is installed. Note that the label statements contain the spaces nec­
essary to space the legend across the top of the graph. These lines were
inserted near the end of the creation process and involved trial and
error to achieve satisfactory results. The lines for the legend will be
drawn later as each line of data is plotted.
The lines which draw the Y-axis, label it, and draw the legend labels
follow:
120 FOR Y»0 TO 150 STEP 25
130 PRINT "PR 1,",Y,"YT;"
140 IF Y<100 THEN PRINT "CP-3,-.25;LB" ;Y; " V
150 IF Y>99 THEN PRINT "CP-4,-.25; LB";Y;"V
1G0 NEXT Y
170 PRINT "PR1,150 CP-3.5, 2 LBSRLES
%^CP-S
l
-\"
180 PRINT "LB(THOUSANDS)
UNITED STRTES
V
190 PRINT "LBEUROPE
JAPAN
SOUTH AMERICAS."
Here's what the graph looks like so far.
SALES *
(THOUSANDS)
150
125
UNITEO STATES
EUROPE
JAPAN
SOUTH AMERICA
m a
1 0 0 -
E
a
4 PUTTING THE COMMANDS TO WORK
M
j
J
A
CALENDAR MONTH
Adding Color and Emphasis
Because the most important part of the graph is the data and title, we
will emphasize these using wide pens in one of two colors. (Wide pens
may be purchased from Hewlett-Packard or your dealer; part numbers
are listed in the Operator's Manual under Accessories Available.) This
program pauses and displays a message on the CRT as a reminder to
change pens. The technique you use will depend on your computer
system. This program also removes the prompt as the first step when
the program continues. You may want to use only two pens in your
whole plot. If so, you can use two colors of the same width or one wide
and one narrow pen and run your program from beginning to end. If
you are not going to change pens, either delete the PAUSE statements
or continue your program immediately when the prompt appears on
your CRT.
A word to the wise: whenever you do want to change pens, insert a
pause in your program. It ensures you will make that pen change at the
proper time and that the pen will not hit your hand as you try to
change pens while plotting is in progress. If a pen was in the pen
holder when your program paused, store it in its stall, manually remove
the old pen from the stall, and replace it with the new pen. Then select
the new pen, using front-panel controls, before you restart your pro­
gram. If you do not reload the pen holder, your program will continue
PUTTING THE COMMANDS TO WORK 8-5
I

Advertisement

Table of Contents
loading

Table of Contents