cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
hogi
Level XIII

Graph Builder - small and big subset

I have some (outlier) data points and want to compare the individual values with 2 reference sets.

ideal: points for the small set and violin for the references.

Can I specify this in Graph Builder?

workaround 1: fill the x axis twice

hogi_0-1669194108752.png

 

 

workaround 2: ... with a second question 
use points (for everything) - and packed jitter to get a feeling for the distribution.
But graph Builder is a little lazy when calculating packed jitter positions for larger data sets.

Can i change this behavior?

 

 

hogi_9-1669193036001.png    hogi_6-1669192713351.png       hogi_7-1669192761837.png

 

View more...
generatePlot=Function ({nRows},{Default Local},
	dt = New Table();
	dt << add rows( nRows );
	dt:Column1 << set name( "group" ) << Set Modeling Type( "Nominal" ) <<
	Formula( tmp=Random uniform( 2 );If(tmp<0.001,0,tmp < 0.5, 1,2) );
	
	dt << New Column( "select", Formula( Random Uniform( ) ) );
	dt << New Column( "rnd", Formula( Random Normal( ) ) );

Graph Builder(
	Size( 523, 411 ),
	Show Control Panel( 0 ),
	Graph Spacing( 4 ),
	Variables(
		X( :group ),
		Y( :rnd ),
		Overlay( :group )
	),
	Elements( Position( 1, 1 ), Points( X, Y, Legend( 17 ), Jitter( "Packed" ) ) )
));


generatePlot(100000); // how it should look like
generatePlot(500000); // larger data set
generatePlot(1000000); // even larger data set

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Graph Builder - small and big subset

You could build that in one chart by creating separate x or y columns for each type of graph you want, and then limit which variables are used in each feature.

 

ih_0-1670364776635.png

 

Code to reproduce:

View more...
Names default to here(1);

generatePlot=Function ({nRows},{Default Local},
	dt = New Table();
	dt << add rows( nRows );
	dt:Column1 << set name( "group" ) << Set Modeling Type( "Nominal" ) <<
	Formula( tmp=Random uniform( 2 );If(tmp<0.001,0,tmp < 0.5, 1,2) );
	
	dt << New Column( "select", Formula( Random Uniform( ) ) );
	dt << New Column( "rnd", Formula( Random Normal( ) ) );
	dt << New Column("Reference", Numeric, "Continuous", Format("Best", 12), Formula(If(:group == 0, Empty(), :rnd)));
	dt << New Column("Value", Numeric, "Continuous", Format("Best", 12), Formula(If(:group == 0, :rnd)));

	dt << Graph Builder(
		Size( 840, 589 ),
		Show Control Panel( 0 ),
		Variables( X( :group ), Y( :Reference ), Y( :Value, Position( 1 ) ) ),
		Elements(
			Points( X, Y( 2 ), Legend( 19 ) ),
			Box Plot( X, Y( 2 ), Legend( 22 ) ),
			Contour( X, Y( 1 ), Legend( 23 ) )
		),
		SendToReport(
			Dispatch( {}, "graph title", TextEditBox, {Set Text( "rnd vs. group" )} ),
			Dispatch( {}, "Y title", TextEditBox, {Set Text( "rnd" )} )
		)
	)	
);


//All three should look the same
generatePlot(100000);
generatePlot(500000);
generatePlot(1000000);

 

View solution in original post

2 REPLIES 2
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Graph Builder - small and big subset

You could build that in one chart by creating separate x or y columns for each type of graph you want, and then limit which variables are used in each feature.

 

ih_0-1670364776635.png

 

Code to reproduce:

View more...
Names default to here(1);

generatePlot=Function ({nRows},{Default Local},
	dt = New Table();
	dt << add rows( nRows );
	dt:Column1 << set name( "group" ) << Set Modeling Type( "Nominal" ) <<
	Formula( tmp=Random uniform( 2 );If(tmp<0.001,0,tmp < 0.5, 1,2) );
	
	dt << New Column( "select", Formula( Random Uniform( ) ) );
	dt << New Column( "rnd", Formula( Random Normal( ) ) );
	dt << New Column("Reference", Numeric, "Continuous", Format("Best", 12), Formula(If(:group == 0, Empty(), :rnd)));
	dt << New Column("Value", Numeric, "Continuous", Format("Best", 12), Formula(If(:group == 0, :rnd)));

	dt << Graph Builder(
		Size( 840, 589 ),
		Show Control Panel( 0 ),
		Variables( X( :group ), Y( :Reference ), Y( :Value, Position( 1 ) ) ),
		Elements(
			Points( X, Y( 2 ), Legend( 19 ) ),
			Box Plot( X, Y( 2 ), Legend( 22 ) ),
			Contour( X, Y( 1 ), Legend( 23 ) )
		),
		SendToReport(
			Dispatch( {}, "graph title", TextEditBox, {Set Text( "rnd vs. group" )} ),
			Dispatch( {}, "Y title", TextEditBox, {Set Text( "rnd" )} )
		)
	)	
);


//All three should look the same
generatePlot(100000);
generatePlot(500000);
generatePlot(1000000);

 

hogi
Level XIII

Re: Graph Builder - small and big subset

nice :)

Recommended Articles