14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

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

Irregular Shapes: Polygons and Contours<br />

Polygons<br />

Polygon works similarly to Line, connecting points but also returning to the first point to close the<br />

polygon and filling the resulting area. You can specify the points as individual points in two-item lists (as<br />

shown for Marker, above) or as matrices of x and then y coordinates. Matrices are flattened by rows, so you<br />

can use either row or column vectors, as long as you have the same number of elements in each matrix. First<br />

set up the matrices of points, then call them inside Polygon().<br />

gCoordX = [25, 23.75, 22.5, 21.25, 21.25, 22.5, 23.75, 25.625, 27.5, 18.75,<br />

12.5, 6.25, 2.5,<br />

1.25, -1.25, 3.125, 6.25, 12.5, 18.75, 25, 29.375, 34.375, 37.5, 38.75,<br />

40.625, 42.5, 43.125,<br />

42.5, 41.25, 38.75, 43.75, 50, 56.25, 60.625, 63.75, 65.625, 62.5, 56.25, 50,<br />

45, 37.5, 32.5,<br />

28.75, 27.5, 26.25, 25.625, 25];<br />

gCoordY = [-2, 2, 5, 10, 15, 20, 25, 30, 33, 34, 35, 37.5, 40, 41, 43.5, 41,<br />

40, 39, 40, 42, 45,<br />

50, 55, 60, 64, 60, 55, 50, 47, 42, 43.5, 43, 42, 40, 38, 36, 37, 37, 36, 35,<br />

30, 25, 20, 15, 10,<br />

5, 2];<br />

New Window( "The JMP man",<br />

Graph Box(<br />

framesize( 300, 300 ),<br />

X Scale( -10, 80 ),<br />

Y Scale( -10, 80 ),<br />

Pen Color( "black" );<br />

Fill Color( "blue" );<br />

Polygon( gCoordX, gCoordY );<br />

Fill Color( "black" );<br />

Circle( {18, 58}, 9, "FILL" );<br />

)<br />

);

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

Saved successfully!

Ooh no, something went wrong!