Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
alaska80
Level I

Plotting fitted Response Funciton

I do not have data, but want to plot this repsonse function y = 72.0 + 3.6x1 - 2.5x2 in JMP to see the contours. How do I do this? Thanks.

2 REPLIES 2
Highlighted
txnelson
Super User

Re: Plotting fitted Response Funciton

is this what you are looking for?

surface plot.PNG

Names Default To Here( 1 );
dt = New Table( "function", New Column( "y" ), New Column( "x1" ), New Column( "x2" ) );

For( i = 1, i <= 100, i++,
	dt << add rows( 1 );
	:x1[N Rows( dt )] = i;
	:x2[N Rows( dt )] = i ^ 2;
);
dt:y << set formula( 72.0 + 3.6 * :x1 - 2.5 * :x1 ^ 2 );

Surface Plot(
	Columns( :y, :x1, :x2 ),
	Surface Color Theme( "Green to Black to Red" ),
	Surface Color Theme2( "Green to White to Red" ),
	Surface Color Theme3( "White to Black" ),
	Surface Color Theme4( "Blue to Gray to Red" ),
	Response Column Color Theme( "Blue to Green to Red" ),
	Response Column Color Theme2( "Spectral" ),
	Response Column Color Theme3( "Jet" ),
	Response Column Color Theme4( "White to Blue" ),
	Formula( "y" ),
	Surface Color Method( "Solid", "Solid", "Solid", "Solid" ),
	SetVariableAxis( :x1, Axis Data( {} ) ),
	SetVariableAxis( :x2, Axis Data( {} ) ),
	SetZAxis( y, Current Value( 100 ), Axis Data( {} ) ),
	SetXVariable( :x1 ),
	SetYVariable( :x2 ),
	Iso Value( 0, 127.5 ),
	Frame3D( Set Rotation( -58.1704596660756, 1.29965884086262, 60.3238676208627 ) )
);
Jim
Highlighted

Re: Plotting fitted Response Funciton

Jim illustrated how JMP can plot functions. It works with Graph Builder and the various profilers. A lot of users don't realize this capability exists. Or they might have forgotten it.

 

But, Jim, that sure is a lot of rows and a lot of code to plot a function. We don't need data. We just need the x and y values to define the plot range. This should do:

 

Names Default To Here( 1 );

dt = New Table( "Function Plot",
	New Column( "y",
		Formula( 72.0 + 3.6 * :x1 - 2.5 * :x2 )
	),
	New Column( "x1", Values( [-1, -1, 1, 1] ) ),
	New Column( "x2", Values( [-1, 1, -1, 1] ) )
);

Surface Plot( Columns( :y, :x1, :x2 ), Formula( "y" ), );
Learn it once, use it forever!
Article Labels

    There are no labels assigned to this post.