Google
 

Trailing-Edge - PDP-10 Archives - BB-AI48A-BM - datatrieve/vt100/draw_bar.cdd-plot
There are 4 other files named draw_bar.cdd-plot in the archive. Click here to see a list.
{]"ie]7_( 0]]0Y_LABEL 0\i] 0X_LABEL \o\nX_POS \t\sY_POS \z\yZERO \\~INDEX ]]STOP ]
]	NEXT]]CNT\@]JTEMP\F\DXAXIS\L\JYAXIS\R\PXLENGTH\X\VYLENGTH\^\\MINVALUE\d\bMAXVALUE \!\hWIDTH \0\& \'VALUESP \
]]!
\@]X!\L]g!_\F]u 0\R^!5]]']
^t],^,^Q^6^E\

],]
^[^j\!]
	]2]

\X_\!	\^_\!	
_/
_z
B
V
[J`,9.HOUSEKEEP40\@\F\L\R]]96LABEL

\X
\X
$
'\X\^9
)LABEL
H\t9
JLABEL]

l\!
v\0]
	\!]
		\\d)"3\L& P\]\dF 0][\Z] 0i2N\U\zx\z| 0\i \@ 0\d*\z. 0\oB\0]	]W]
\or|\F\R Py
Dt@(]
!2\i% P\d6 P 0B   \IoY]
Rc\iV P\dg P 0r   x] 0
K$B;\i\d! P(?1\
 P!6\
e]n\0	x|!q@!8 0(More...)9
K9MDRAW_BARDEFINE PLOT DRAW_BAR
DECLARE STRING VECTOR STRINGS
DECLARE REAL VECTOR VALUES, SCALED_VALUES
$DECLARE X_AXIS, Y_AXIS, X_LENGTH, Y_LENGTH, MIN_VALUE, MAX_VALUE, WIDTH
DECLARE X_POS, Y_POS, ZERO, INDEX, STOP, NEXT, CNT, JTEMP
DECLARE STRING Y_LABEL, X_LABEL
	! Get data points

ENTRY 0 (X_LBL: STRING,
		 Y_LBL: STRING,

	 STRS : STRING VECTOR,
	 VALS : REAL VECTOR)
    BEGIN
		X_LABEL = X_LBL
	X_AXIS = 10
	X_LENGTH = 62
	Y_AXIS = 1
	Y_LENGTH = 21
		Y_LABEL = Y_LBL

	INCR CNT OVER STRS
	    BEGIN
		STRINGS (CNT) = STRS (CNT)
		VALUES (CNT)  = VALS (CNT)
	    END
IN (VALUES)
(VALUES)
    END
ENTRY 2
    BEGIN
		PLOT HOUSEKEEP 0
"	PLOT LABEL 0 (X_AXIS,Y_AXIS, X_LENGTH, Y_LENGTH, X_LABEL, Y_LABEL)
	IF MIN_VALUE GT 0 THEN MIN_VALUE = 0
        PLOT LABEL 3 (MIN_VALUE, MAX_VALUE)
	PLOT LABEL 15 (ZERO)
	INCR CNT OVER VALUES
	    SCALED_VALUES (CNT) = VALUES (CNT)
	PLOT LABEL 8 (SCALED_VALUES)
		STOP = NEXT + 6
	IF STOP GT SIZE (SCALED_VALUES)
	    STOP = SIZE (SCALED_VALUES)
	INDEX = 0
E 0 THEN
 	    WIDTH =      (X_LENGTH - 2) / (STOP - NEXT) ELSE WIDTH = 1
	INCR NEXT FROM NEXT + 1 TO STOP
	    BEGIN

		INDEX = INDEX + 1
		X_POS = X_AXIS + 1 + (WIDTH * (INDEX - 1))
		Y_POS = SCALED_VALUES (NEXT)
		JTEMP = 0
		INCR CNT FROM Y_POS TO Y_AXIS + Y_LENGTH - 2
		  BEGIN
0  THEN
			PRINT TXY(X_POS - 2 + WIDTH / 2, CNT),
			    "   \" ELSE
			PRINT TXY(X_POS - 2 + WIDTH / 2, CNT),
 x"
		    JTEMP = 1
		  END
!		PRINT TXY(X_POS + WIDTH / 2 - LENGTH (STRINGS(NEXT)) / 2, 22),

		    STRINGS(NEXT)
	    END
	IF NEXT LT SIZE (SCALED_VALUES)
	    PRINT TXY(70,24),"(More...)"
		PLOT HOUSEKEEP 2
    END
! Re-sort data by height and replot
ENTRY 3
    BEGIN
	NEXT = 0
	SORT DESC (VALUES, STRINGS)
		PLOT DRAW_BAR 2
    END
END_PLOT