cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar
Bmllnn
Level II

Overlaying histograms and distributions

I would do like to do something similar to this in JMP. 

Bmllnn_0-1748421030593.png

is it possible to do it in the graph builder? 

2 REPLIES 2

Re: Overlaying histograms and distributions

Hi,

 

this is not exactly your plot but you can build overlayed distributions in the Graph Builder like this:

 

Jonas_Rinne_0-1748423211024.png

 

Datatable = open("$SAMPLE_DATA/Big Class.jmp") << 
Graph Builder(
	Size( 528, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :height ), X( :weight, Position( 1 ) ) ),
	Elements(
		Histogram(
			X( 1 ),
			X( 2 ),
			Legend( 5 ),
			Histogram Style( "Kernel Density" ),
			Smoothness( 0.1743 )
		),
		Histogram( X( 1 ), X( 2 ), Legend( 10 ) )
	),
	SendToReport(
		Dispatch( {}, "height", ScaleBox,
			{Min( 38.5123966942149 ), Max( 183 ), Inc( 10 ), Minor Ticks( 1 )}
		)
	)
);

Cheers,

Jonas

 

 

 

jthi
Super User

Re: Overlaying histograms and distributions

And if you tinker a little bit with customize options you can also modify how the kernel density looks (modify line style, width and set fill pattern to no fill)

jthi_1-1748423875010.png

Idea here (and with earlier solution) is to add two distributions on top of each other, one with Bar and one with Kernel Density style. You can do this by right clicking on the graph and select Add > Histogram and then modify the settings

jthi_2-1748423967505.png

 

-Jarmo

Recommended Articles