Plotting Charts and Curves on the T/S 2040

See all articles from Sinc-Link v8 n5
Author(s): Warren Fricke
Publication: Sinc-Link
Pub Details: Sinc-Link v8 n5 (Volume 8, Issue 5)
Date: September/October 1990
Pages: 10-11

In this demonstration we will show how the T/S 2068 and its running mate, the T/S 2040, can accept 12 INPUT values and convert them into a Vertical Bar Chart or a Point to Point Curve. Routine “D-17” is the basic program for the bar chart and “D-19” is a similar program for the point-to-point curve. You can enter any 12 dollar amounts. In practice, however, these amounts would be of about the same magnitude, thus presenting a reasonable looking figure.

About the only difference between these two routines is in the area of lines 208 to 240.

There is another feature to the routines that adds to their utility. The programs are written so that the output is sent to the T/S 2040 printer, with both the upper and lower half continuously and automatically copied. Thus they are blended into a single illustration.

Now I wonder how many other more sophisticated computer-printer combinations can match this effectiveness and simplicity of providing a hard copy of similar data, with a basic program that is readily altered to suit one’s needs?

Warren Fricke,
WNY User Group

   5 REM ** MODEL OF A VERTICLE         BAR CHART.
10 REM ** "D-17", 2-10-88, WF
30 DRAW 0,175: DRAW 255,0: DRAW 0,-175
40 PRINT AT 1,4;"** SALES of DO-DADS **";AT 3,1;"MONTH","DOLLARS"
50 DIM a$(30): DIM s(12)
60 FOR n=1 TO 12
70 INPUT "Enter sales, month No. ";(n);" ";s(n)
80 PRINT AT 4+n,3;n,s(n)
85 NEXT n
90 LET max=0
100 FOR n=1 TO 12
110 IF s(n)>max THEN LET max=s(n)
120 NEXT n
130 LET min=max
140 FOR n=1 TO 12
150 IF s(n)<min THEN LET min=s(n)
160 NEXT n
170 PRINT AT 18,1;"Highest Month = ";max;AT 19,1;"Lowest Month = ";min
180 PRINT AT 20,1;"Have PRINTER ready, and press";AT 21,1;" ENTER if data is OK.": INPUT c$
190 PRINT AT 20,1;a$;AT 21,1;a$: COPY : CLS
202 PRINT AT 6,1;"DOLLARS";AT 8,3;"of";AT 10,2;"SALES"
205 PRINT AT 20,1;"MONTH J F M A M J J [illegible] O N D"
207 PLOT [illegible],17: DRAW 246,0
210 FOR n=[illegible]7 TO [illegible]43 STEP 16
220 FOR m=[illegible] TO 1
230 PLOT n+m,17: DRAW 0,s((n-67)/16+1)*158/max
240 NEXT m: NEXT n
250 PLOT 0,175: DRAW 0,-175: DRAW 255,0: DRAW 0,175
260 COPY
Vertical bar chart printout: SALES of DO-DADS
Vertical bar chart printout: SALES of DO-DADS
   5 REM ** MODEL OF A POINT TO         POINT CURVE
10 REM ** "D-19", 3-2-88, WF
30 DRAW 0,175: DRAW 255,0: DRAW 0,-175
40 PRINT AT 1,4;"** SALES of DO-DADS **";AT 3,1;"MONTH","DOLLARS"
50 DIM a$(30): DIM s(12)
60 FOR n=1 TO 12
70 INPUT "Enter sales, month No. ";(n);" ";s(n)
80 PRINT AT 4+n,3;n,s(n)
85 NEXT n
90 LET max=0
100 FOR n=1 TO 12
110 IF s(n)>max THEN LET max=s(n)
120 NEXT n
130 LET min=max
140 FOR n=1 TO 12
150 IF s(n)<min THEN LET min=s(n)
160 NEXT n
170 PRINT AT 18,1;"Highest Month = ";max;AT 19,1;"Lowest Month = ";min
180 PRINT AT 20,1;"Have PRINTER ready, and press";AT 21,1;" ENTER if data is OK.": INPUT c$
190 PRINT AT 20,1;a$;AT 21,1;a$: COPY : CLS
202 PRINT AT 6,1;"DOLLARS";AT 8,3;"of";AT 10,2;"SALES"
205 PRINT AT 20,1;"MONTH J F M A M J J A S O N D"
207 PLOT 4,17: DRAW 246,0
208 PLOT 67,17+s(1)*158/max
210 FOR n=83 TO 243 STEP 16
220 LET y1=17+s((n-83)/16+1)*158/max
230 LET y2=17+s((n-67)/16+1)*158/max
240 DRAW 16,y2-y1: NEXT n
250 PLOT 0,175: DRAW 0,-175: DRAW 255,0: DRAW 0,175
260 COPY
Point-to-point curve printout: SALES of DO-DADS
Point-to-point curve printout: SALES of DO-DADS

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.