(* PROJECT : StatPascal example program FILE-SPEC. : plotdemo.sp AUTHOR : R.-D. Reiss, M. Thomas CREATION DATE : Dec-22-2000 LAST UPDATE : Dec-22-2000 VERSION : 1.0 FUNCTIONAL DESCR.: Demonstration of StatPascal plot routines REQUIRES : - OUTPUT : Creates four plot windows demonstrating the controlling of Xtremes plot options from StatPascal SPECIAL FEATURES : None *) program PlotDemo; const Pi = 3.1415; procedure Circles; var x, y: vector of real; begin x := cos (realvect (0, 2 * Pi, 100)); y := sin (realvect (0, 2 * Pi, 100)); SetColor (ColorRed); plot (x, y, 'Circle', 'Red circle'); SetColor (ColorGreen); plot (0.9 * x, 0.9 * y, 'Circle', 'Green circle'); SetColor (ColorBlue); plot (0.8 * x, 0.8 * y, 'Circle', 'Blue circle'); SetColor (ColorGrey); plot (0.7 * x, 0.7 * y, 'Circle', 'Grey circle'); SetColor (ColorBlack); plot (0.6 * x, 0.6 * y, 'Circle', 'Black circle'); SetCoordinates ('Circle', -1.1, -1.1, 1.1, 1.1); end; procedure Labels; begin SetLabel ('Label', VerticalPositionTop or HorizontalPositionCentered, 0, 0, 'Top Center'); SetLabel ('Label', VerticalPositionCentered or HorizontalPositionLeft or VerticalDisplay, 0, 0, 'Vertical Text Left'); SetLabel ('Label', VerticalPositionUser or HorizontalPositionUser or VerticalAlignmentBottom or HorizontalAlignmentLeft, 0, 0, 'Starts at Coordinate Origin'); SetLabel ('Label', VerticalPositionUser or HorizontalPositionUser or VerticalAlignmentTop or HorizontalAlignmentRight, 0, 0, 'Ends at Coordinate Origin'); SetTicks ('Label', -1, 1, 0.1, -1, 1, 2); SetMarkers ('Label', -1, 1, 2, -2, 3, 2.5) end; procedure LineStyles; var x, y: vector of real; begin x := combine (-3, 3); y := combine (2.5, 2.5); SetLineStyle (DashedLine); Plot (x, y, 'LineStyles', 'Dashed'); y := y - 0.5; SetLineStyle (DottedLine); Plot (x, y, 'LineStyles', 'Dotted'); y := y - 0.5; SetLineStyle (DashDottedLine); Plot (x, y, 'LineStyles', 'DashDotted'); y := y - 0.5; SetLineStyle (SolidLine); Plot (x, y, 'LineStyles', 'Solid'); y := y - 0.5; SetLineStyle (UserLine); SetLineOptions (3, 15, 10); Plot (x, y, 'LineStyles', 'User Defined'); end; procedure PlotStyles; var x, y: realvector; begin x := realvect (-3, 3, 100); y := gaussiandensity (x); SetColor (ColorBlue); SetPlotStyle (AreaStyle); Plot (x, y, 'PlotStyles', 'AreaStyle'); SetCoordinates ('PlotStyles', -3, 0, 3, 0.6); SetLineStyle (SolidLine); SetLineOptions (5, 0, 0); SetColor (ColorRed); SetPlotStyle (LineStyle); Plot (x, y, 'PlotStyles', 'LineStyle'); SetColor (ColorGreen); SetLineOptions (1, 0, 0); SetPlotStyle (BarStyle); Plot (x, y, 'PlotStyles', 'BarStyle'); SetPlotStyle (StaircaseStyle); Plot (x, y + 0.1, 'PlotStyles', 'StaircaseStyle'); SetLineOptions (5, 0, 0); SetPlotStyle (BoxStyle); Plot (x, y + 0.05, 'PlotStyles', 'BoxStyle'); SetLineOptions (3, 0, 0); SetPlotStyle (PointStyle); SetColor (ColorGrey); Plot (x, y + 0.15, 'PlotStyles', 'PointStyle') end; begin Circles; Labels; LineStyles; PlotStyles end.