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
Learner_JMP
New Member

How to show multiple summary statistics in a graph for single set of points

Hi, 

I'm building a graph using a scattered plot.

My points are based on the "mean" statistics.

I'd like to add labels of "mean" and "N" statistics to the same points. 

Since the scale is very different between "mean" and "N", adding second set of same points to the graph hides all the differences of "mean" statistics.

How can I show both statistics to the single set of "mean" points?

I'm hoping I don't have to use JSL script if there's a simple way to do this.

If I have to script, I tried this but "N" labels never show up while "mean" labels show up as expected.

Can anybody help?

Thank you so much!

Graph Builder(
	Variables( X( :p ), Y( :a ) ),
	Elements(
		Points(
			X,
			Y,
			Legend( 5 ),
			Summary Statistic( "Mean" ),
			Marker Size( 8 ),
			Marker Color( "Medium Blue" ),
			Label( "Label by Value" ),

		)
	),
	Elements(
		Text(
			X,
			Y,
			Summary Statistic( "N" ),
			Label( "Name and Value" ),
			Jitter( 0 ),
			Label Justification( "Right" ),
			Set Font Style( "Bold" ),
			Set Font Size( 12 )
		)
	),
	SendToReport( Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Mean Points with N Labels" )} ) )
);

txnelson edit: moved code to JSL display box

 

Learner_JMP_0-1764965117079.png

 

 

4 REPLIES 4
hogi
Level XIII

Re: How to show multiple summary statistics in a graph for single set of points

How about Caption / Graph per factor?

hogi_1-1764966625275.png

 

hogi_0-1764966604996.png

 

 

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Graph Builder(
	Size( 643, 335 ),
	Graph Spacing( 4 ),
	Variables( X( :age ), Y( :height ) ),
	Elements(
		Points( X, Y, Legend( 4 ), Summary Statistic( "Mean" ) ),
		Caption Box(
			X,
			Y,
			Legend( 5 ),
			Summary Statistic( "Mean" ),
			Summary Statistic 2( "N" ),
			Location( "Graph per factor" )
		)
	)
);


 

hogi
Level XIII

Re: How to show multiple summary statistics in a graph for single set of points

Use a column to create the label - and use it as Shape Column

hogi_2-1764966926048.png

hogi_5-1764967794949.png

 


Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Column( "label",
	Character,
	Formula(
		Char( Round( Col Mean( :height, :age ) ) ) || "
" ||
		Char( Col Number( :height, :age ) )
	)
);

Graph Builder(
	Variables( X( :age ), Y( :height ) ),
	Elements(
		Points(
			X,
			Y,
			Legend( 3 ),
			Summary Statistic( "Mean" ),
			Set Shape Column( :label )
		),
		Points( X, Y, Legend( 4 ), Summary Statistic( "Mean" ) )
	),
	SendToReport(
		Dispatch( {}, "400", ScaleBox,
			{Legend Model(
				4,
				Properties( 0, {Marker( "Circle" ), Marker Size( 30 )}, Item ID( "Mean", 1 ) )
			)}
		)
	)
);

 

hogi
Level XIII

Re: How to show multiple summary statistics in a graph for single set of points

you can stack different types of markers, like Bar/Float, Circle and marker with Marker shape:
N: inside the circle
mean: on the right

hogi_2-1764968419245.png

Learner_JMP
New Member

Re: How to show multiple summary statistics in a graph for single set of points

Thank you so much, hogi!

This is exactly how I envisioned!

You made my day!!!

Recommended Articles