Google
 

Trailing-Edge - PDP-10 Archives - BB-AI48A-BM - datatrieve/vt125/bar_average.cdd-plot
There are 4 other files named bar_average.cdd-plot in the archive. Click here to see a list.
hBEB\CDZ0BKBJ0XLABEL0B@BP0YLABELB"BDINDEXB1B&B(VALUESPBB5B7COUNTSP0B0BSTRINGS
0BEC0STNGCCVALUECC2CCzD)B@C!CBC7CCDD B"B@DC
B"B@D3DMB1B@DCDQB1B@ 0EnD^E_EiB@DoB"DyEB"B@E	EB"B@B1B@E' BEBKBB"9E)DRAW_BAREf9EhDRAW_BAR
DEFINE PLOT BAR_AVERAGE
DECLARE STRING VECTOR STRINGS
DECLARE REAL VECTOR VALUES, COUNTS
DECLARE INDEX
DECLARE STRING X_LABEL, Y_LABEL
ENTRY 0 (X_LBL : STRING, Y_LBL : STRING)
    BEGIN
		X_LABEL = X_LBL
		Y_LABEL = Y_LBL
    END
ENTRY 1 (STNG : STRING, VALUE)
    BEGIN
	INDEX = SEARCH (STNG, STRINGS)
	IF INDEX EQ 0
	    INDEX = SIZE (STRINGS) + 1

	STRINGS (INDEX) = STNG
	VALUES (INDEX) = VALUES (INDEX) + VALUE
	COUNTS (INDEX) = COUNTS (INDEX) + 1
    END
ENTRY 2
    BEGIN

	INCR INDEX OVER VALUES
	    VALUES (INDEX) = VALUES(INDEX) / COUNTS(INDEX)
	PLOT DRAW_BAR 0 (X_LABEL, Y_LABEL, STRINGS, VALUES)
		PLOT DRAW_BAR 2
    END
END_PLOT