Setting Contour Options

procedure TGaltonForm.FormCreate(Sender: TObject);

{From the Galton board sample program.}

var i:Integer; Contours:THeight;

begin

with MatPlot do

begin

ResizeMat(Gridsize,Gridsize); {Make sure the matrix is 20 x 20.}

FillMat(1);

showGrid:=True;

autoscaleContour:=False;

contnum:=4; {Tells the MatPlot that we only want to use 4 contours}

{Set the contour levels.}

for i:=1 to maxContNum do Contours[i]:=i; {Set the contours to be drawn at 1,2,3,4....}

setContourHeights(contours); {Send the contours to the MatPlot}

{Set the colors for the 4 contours that we want to use.}

SetContourColor(1,clGreen); {background}

SetContourColor(2,clRed);{ball}

SetContourColor(3,clSilver);{empty slot}

SetContourColor(4,clWhite);{full slot}

end;

end;