Google
 

Trailing-Edge - PDP-10 Archives - BB-AI48A-BM - datatrieve/vt125/draw_bar.cdd-plot
There are 4 other files named draw_bar.cdd-plot in the archive. Click here to see a list.
I3!W!IUM)V` 0I9I80Y_LABEL 0I-I>0X_LABEL HoI2START_BAR HuHtX_POS HzHyY_POS IHZERO IISCALE_VAL II
INDEXIISTOPIINEXTIICNTI"I3MAXSTR I'I&DIAG H@I,SHADOW2HFHDXAXISHLHJYAXIS HRHPXLENGTH HXHVYLENGTH H^H\MINVALUE HdHbMAXVALUE HiHhWIDTH H!HnSHADOW H0H& H'VALUESP H
JJ'J8KYL!L5LJI9I?HLJ"R`HFJ"6@HRJ#	"5pI3IE
IJIJyK	H!IIPIKK6KIK&H
IK@KJH
K]LKnK{KgKrIKk x tHLL!LLI"L
 0I9L 0L HXL+	H!H^L?
H!LNL_LuLRL\H! xHdLn
HLLr!HdM
HLMM
MM	M PH! 0VU
M1NMzNBNVN[OO%O;OhOvPUyVVPM-9M/HOUSEKEEPM50H@HFHLHRI9I39M7LABEL	N
NHHz9NJLABELINlH!NvOH0I
H!IOH09OLABEL
IO4IO8 xO@OSIOIH0
IO]H0
IOrO{P
 0P
T(B)P 0PT(B)[10,2]IP*IUlIP. 0	P8POQQQ5QZRRRwS:TMTUUgIPGIPK 0HoP_H@PhHdPy
PoP}PlI P 0HuQH0I
HiQ,HdQ0
 XQ9QIHzHFHzHFQ^RHiQnHzQxH0I
R
R.HiR$RHzH0I
HiR=HzRHH0I
RVRcHiR`HiRmHiR{SS)HzSH0I
I'SHiI'HiS?SLSbI'SII-S[HzS_ PI-HzSuSzTTT"T'T2T7TH 0SwP	HoI- 0T(B)W(I(C)S1)P	HoHu 0T$V(BW(E))	Hd
 0T4(B)V
HiI'0TKW(S0)P(E)V(E)(E)TZTfvUH@THdU
UUUI P UU" pU+H
U5U9UOUS 0U8P	HoUHHFUL! 0URW(I(W))tU]H
Uv 0UxT(E)VVHIVH0
VVVC 0Vp	V/V<V%V3H@HL!v@HFV@!^ 0VFT"(More...)"VM9VOHOUSEKEEPWVdWWIVmH!H
WDEFINE PLOT DRAWBAR
DECLARE STRING VECTOR STRINGS
DECLARE REAL VECTOR VALUES, SCALED_VALUES
	(DECLARE X_AXIS, Y_AXIS, X_LENGTH, Y_LENGTH, MIN_VALUE, MAX_VALUE, WIDTH, SHADOW
	+DECLARE X_POS, Y_POS, ZERO, SCALE_VAL, INDEX, STOP, NEXT, CNT, MAX_STR, DIAG, SHADOW2
	DECLARE START_BAR
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 = 100
	X_LENGTH = 600
	Y_AXIS = 360
	Y_LENGTH = 350
		Y_LABEL = Y_LBL

	INCR CNT OVER STRS
	    BEGIN
		STRINGS (CNT) = STRS (CNT)
		VALUES (CNT)  = VALS (CNT)
		IF LENGTH (STRINGS(CNT)) GT MAX_STR
		    MAX_STR = LENGTH (STRINGS (CNT))
	    END
	IF MAX_STR * 6 + 5 GT X_LENGTH / 9
	    BEGIN
		DIAG = 1
		X_LABEL = " "
	    END
IN (VALUES)
(VALUES)

	IF SIZE (VALUES) GE 6
	    THEN WIDTH = X_LENGTH / 13
	    ELSE WIDTH = X_LENGTH / (2 * SIZE(VALUES) + 1)
    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
	IF DIAG EQ 0

	    THEN PRINT "T(B)"
	    ELSE PRINT "T(B)[10,2]"
	INCR NEXT FROM NEXT + 1 TO STOP
	    BEGIN

		INDEX = INDEX + 1
		X_POS = X_AXIS + WIDTH * (2 * INDEX - 1)
		Y_POS = SCALED_VALUES (NEXT)
		SHADOW = WIDTH / 3
IS THEN

		    ZERO = Y_AXIS
		IF SHADOW GE ZERO - SCALED_VALUES (NEXT) THEN
		   IF SHADOW GE SCALED_VALUES (NEXT) - ZERO THEN
			SHADOW = ZERO - SCALED_VALUES (NEXT)
		IF SHADOW < 0 THEN SHADOW = - SHADOW
		IF ZERO LT SCALED_VALUES (NEXT)
		    THEN SHADOW2 = - SHADOW
		    ELSE SHADOW2 = SHADOW
			IF SHADOW2 > 0
		    THEN START_BAR = ZERO - 2
		    ELSE START_BAR = ZERO
		PRINT "P", LXY (X_POS, START_BAR), "(B)W(I(C)S1)P",
OS, YPOS),
		    "V(BW(E))", RX (WIDTH), "(B)V", RXY (SHADOW, SHADOW2),
(E)(E)"
		IF DIAG EQ 0
		    THEN X_POS = X_AXIS + (WIDTH * (2 * INDEX - .5)) - 4
			     * LENGTH (STRINGS (NEXT))
		PRINT "P",LXY (X_POS, Y_AXIS + 15), "W(I(W))t",
		    QUOTE (STRINGS(NEXT))
	    END
	PRINT "T(E)"
	IF NEXT LT SIZE (SCALED_VALUES)
	    PRINT "p", LXY (X_AXIS + X_LENGTH - 90, Y_AXIS + 60),

		"T""(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