cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
cdwang9507
Level I

JMP scripting on Bivariate plot

Dear JMP script experts,

 

Below is an example to illustrate I am trying to do.  wondering if any expert can help or shed the light on writing the script. 

cdwang9507_0-1706422691104.png

By using Bivariate Fit of Y by X to generate a plot.  And the row legend is Z column.  Each data point of Z is plotted as square (not circle as default.  And Z=1 is plotted as green color, Z=2 is plotted as blue color and Z=3 is plotted as red color.  

 

It seems the script on the right side does not work for other table.

 

appreciated it for the helps. 

2 REPLIES 2
jthi
Super User

Re: JMP scripting on Bivariate plot

Which table it doesn't work with? What goes wrong? Is there a message in log? Which JMP Version are you using?

-Jarmo
txnelson
Super User

Re: JMP scripting on Bivariate plot

I was not able to correct your issue using Bivariate, however, it works correctly using Graph Builder.

txnelson_0-1706427756588.png

names default to here( 1 );
dt = current data table();

// Set selected rows' colors
dt << Select Where( :Z == 1 ) << Colors( "Dark Red" );
dt << Select Where( :Z == 2 ) << Colors( "Dark Green" );
dt << Select Where( :Z == 3 ) << Colors( "Dark Blue" );
dt << Select All Rows << Markers( "FilledSquare" );

Graph Builder(
	Size( 531, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :X ), Y( :Y ), Overlay( :Z ) ),
	Elements( Points( X, Y, Legend( 3 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"X",
			ScaleBox,
			{Min( 0.92068931615959 ), Max( 2.08769739976682 ), Inc( 0.2 ),
			Minor Ticks( 1 )}
		),
		Dispatch(
			{},
			"Y",
			ScaleBox,
			{Min( 0.866326530612245 ), Max( 2.12682788421491 ), Inc( 0.2 ),
			Minor Ticks( 0 )}
		),
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				3,
				Properties( 0, {Marker Size( 6 )}, Item ID( "1", 1 ) ),
				Properties( 1, {Marker Size( 6 )}, Item ID( "2", 1 ) ),
				Properties( 2, {Marker Size( 6 )}, Item ID( "3", 1 ) )
			)}
		)
	)
)

Jim