cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Sherif_96
Level III

Surface plot

If I have a surface plot, is there a method to visualize or color the maximum points on the surface?
4 REPLIES 4
txnelson
Super User

Re: Surface plot

You can add to the Surface Plot the points, and then select the point you want to change the color on, and then set the rowstate color in the data table.  It will change that selected point to the color you changed the row's color state to.

txnelson_0-1718575376047.png

Others may have additional ideas on how to do this

 

Jim
Sherif_96
Level III

Re: Surface plot

I appreciate your response and additions, but unfortunately, I don't know the maximum points, so if there is an option or a function to determine the maximum points first, then coloring them automatically on the surface
txnelson
Super User

Re: Surface plot

You can use this little script to set the row state color for the row with the maximum value

Names Default To Here( 1 );
dt = Current Data Table();
dt << select where( :parameter 1 == Col Max( :parameter 1 ) );
Row State( (dt << get selected rows)[1] ) = Color State( red );

Just change "parameter 1" to the name of your target column

Jim
Craige_Hales
Super User

Re: Surface plot

You can get this interactively; I pasted the script together from the captured bits in the log window.

right-click the surface to get to various settingsright-click the surface to get to various settings

 

 

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt:age << Set Modeling Type( "Continuous" );

// Save Columns: Prediction Formula
Local( {obj},
	obj = dt << Fit Model(
		Y( :height ),
		Effects( :age, :weight, :age * :age, :age * :weight, :weight * :weight ),
		Personality( "Standard Least Squares" ),
		Emphasis( "Effect Leverage" ),
		Run(
			:height << {Summary of Fit( 1 ), Analysis of Variance( 1 ), Parameter Estimates( 1 ), Scaled Estimates( 0 ),
			Plot Actual by Predicted( 1 ), Plot Regression( 0 ), Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ),
			Plot Effect Leverage( 1 ), Plot Residual by Normal Quantiles( 0 ), Box Cox Y Transformation( 0 )}
		)
	);
	obj << Prediction Formula;
	obj << Close Window;
);


// Launch platform: Surface Plot
dt << Surface Plot(
	Columns( :Pred Formula height, :height, :weight, :age ),
	Datapoints Choice( "Points" ),
	Surface Color Theme( "Green to Black to Red"(1) ),
	Surface Color Theme2( "Green to White to Red"(1) ),
	Surface Color Theme3( "White to Black"(1) ),
	Surface Color Theme4( "Blue to Gray to Red"(1) ),
	Surface Gradient Type( "Discrete Gradients" ),
	Response Column Color Theme( "Blue to Green to Red"(1) ),
	Response Column Color Theme2( "Blue to Gray to Orange"(1) ),
	Response Column Color Theme3( "Spectral"(1) ),
	Response Column Color Theme4( "Jet"(1) ),
	Formula( "Pred Formula height" ),
	Response( :height ),
	Equation( "", "", "", "" ),
	Surface Color Method( :Pred Formula height, "Solid", "Solid", "Solid" ),
	SetVariableAxis( :weight, Axis Data( {} ) ),
	SetVariableAxis( :age, Axis Data( {} ) ),
	SetZAxis( :Pred Formula height, Current Value( 61.1938701849204 ) ),
	SetXVariable( :age ),
	SetYVariable( :weight ),
	Iso Value( 0, 62.7178599852511 ),
	Iso Value( 1, 60.8 ),
	Iso Value( 2, 60.8 ),
	Iso Value( 3, 60.8 ),
	Frame3D(
		Set Graph Size( 857, 648 ),
		Set Rotation( -67.6102735250083, -0.17489981039149, -124.30542455474 ),
		Set Line Scale( 0.2207 ),
		Set Text Scale( 1.2122 ),
		Set Marker Quality( 0.622 ),
		Set Marker Scale( 2.1524 )
	)
);

 

Craige