14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

410 <strong>Scripting</strong> Graphs Chapter 12<br />

Drawing Lines, Arrows, Points, and Shapes<br />

);<br />

Figure 12.14 Drawing Circles<br />

Rectangles<br />

Note that a circle is always a circle, even if you re-size the graph to a different aspect ratio. If you want your<br />

circle to change aspect ratios (in other words, cease being a circle) when the graph is resized, use an oval<br />

instead.<br />

If you do not want your circle to resize if the graph is resized, specify the radius in pixels instead:<br />

New Window("Circles",<br />

Graph Box(framesize(200, 200),<br />

Circle({50, 50}, PixelRadius(10), PixelRadius(12), PixelRadius(25))));<br />

Rect draws a rectangle from the diagonal coordinates you specify. The coordinates can be specified either<br />

as four arguments in order (left, top, right, bottom), or as a pair of lists ({left, top}, {right,<br />

bottom}).<br />

New Window( "Rectangles",<br />

Graph Box( framesize( 200, 200 ),<br />

Pen Color( 1 ); Rect( 0, 40, 60, 0 );<br />

Pen Color( 3 ); Rect( 10, 60, 70, 10 );<br />

Pen Color( 4 ); Rect( 50, 90, 90, 50 );<br />

Pen Color( 5 ); Rect( 0, 80, 70, 70 );<br />

)<br />

)<br />

Rect has an optional fifth argument, fill. Specify a zero to get an unfilled rectangle, and a one to get a<br />

filled rectangle. The rectangle is filled with the current fill color. The default value for fill is 0.<br />

Any negative fill argument produces an unfilled frame inset by one pixel:<br />

New Window( "Framed rectangle",<br />

Graph Box( framesize( 200, 200 ),<br />

Rect( 0, 40, 60, 0, -1 )<br />

)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!