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.

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

Interactive graphs<br />

You can use other functions to constrain Handle. For example, here is an interactive graph to demonstrate<br />

power functions that uses Round() to prevent bad exponents and to keep the intercepts simple.<br />

a = 3; b = 2;<br />

New Window( "Intercepts and powers",<br />

Graph Box(<br />

FrameSize( 200, 200 ), X Scale( -10, 10 ), Y Scale( -10, 10 ),<br />

Y Function( Round( b ) + x ^ (Round( a )), x );<br />

Handle( a, b, a = x; b = y; );<br />

Text( {a, b}, " Move me" );<br />

Text( {-9, 9}, "y=", Round( b ), " + x^", Round( a ) );<br />

)<br />

);<br />

Figure 12.23 Intercepts and Powers Example for Handle<br />

Handle and For can be nested for complex graphs.<br />

a=5; b=5;<br />

New Window("powers",<br />

Graph Box(FrameSize(200,200),XScale(-10,10),yScale(-10,10),Double Buffer,<br />

for(i=0,i

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

Saved successfully!

Ooh no, something went wrong!