该帮助的版本不再更新,请参见https://www.jmp.com/support/help/zh-cn/15.2 获取最新的版本.


win = New Window( "Wiggle Wave",
Graph Box(
Frame Size( 500, 300 ),
X Scale( -5, 5 ),
Y Scale( -5, 5 ),
Y Function( amplitude * Sine( x / freq + phase ), x );
Handle(
/* current values of phase and amplitude position the square handle.
/* x and y have been set to the handle’s position
Handle( freq, .5, freq = x );
// Handle works similarly except that the y value is .5
Text( // display a text string in the graph
{3, 4},
"amplitude: ",
Round( amplitude, 4 ), // display the current value
{3, 3.5},
"frequency: ",
Round( freq, 4 ), // display the current value
{3, 3},
"phase: ",
Round( phase, 4 ) // display the current value
tf = win[Frame Box( 1 )]; // get the frame box (the graph)
For( amplitude = -4, amplitude < 4, amplitude += .1,// animate the amplitude
tf << Reshow // force the graph to update
amplitude = 1; // use for loops for more complex movement
For( i = 0, i < 1000, i++,
amplitude += (Random Uniform() - .5);
freq += (Random Uniform() - .5) / 20;
phase += (Random Uniform() - .5) / 10;
tf << Reshow;
Wait( .05 );