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

Boxplot with points, showing the points in associated Box

Currently in a Boxplot using JMP 16.1.0, if more than one result is plotted on y-axis, the boxes can be visulaized with an "offset" or "Align" (Box placement). This function is not given for "points".

I would like to have this functionality to get a better representation of my results and to avoid an intermediate step, e.g. by restacking.

 

2021-11-11_example_1.jpg

8 Comments
ANS
Level II

The problem is more visible in this example, see data from group "A":

2021-11-11_example_2.jpg

hogi
Level XII

for comparison:
for a related issue, there is a workaround available:overlay -> use it again on the x axis.

hogi_0-1722640090406.png

 

hogi_1-1722640140832.png

 

Vball247
Level V

Still a bug in 18.1.1. Points do not line up with Boxplots or Contour Plots (violin in this example). Our users also would like the points to show in the boxplot. Why the offset?

 

Even with using the nested option for the x-axis, the points are offset for some of the boxplots.

 

Vball247_2-1739546229741.png

 

Without nesting the points are just jittered around the center

 

Vball247_3-1739546291765.png

 

 

 

hogi
Level XII

@Vball247 , 

- use it again on the x -axis.

then you don't need to spread the box plots another time.
-> deactivate via

hogi_1-1739602558528.png

 



Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Graph Builder(
	Size( 595, 397 ),
	Show Control Panel( 0 ),
	Summary Statistic( "Median" ),
	Graph Spacing( 4 ),
	Variables(
		X( :sex ),
		X( :age, Position( 1 ) ),
		Y( :height ),
		Overlay( :age )
	),
	Elements(
		Points( X( 1 ), X( 2 ), Y, Legend( 8 ) ),
		Box Plot( X( 1 ), X( 2 ), Y, Legend( 9 ), Box Placement( "Align" ) )
	)
);

maybe more convincing that it works:

hogi_0-1739602530833.png

 

hogi
Level XII

For the original problem, one has the options:

A) with align:

hogi_1-1739602790351.png

 

hogi_0-1739602781042.png


B) with Offset

hogi_2-1739602823348.png
hogi_3-1739602855052.png


Unfortunately, the workaround from above doesn't work.

 As an alternative, you can stack the data and use the workaround from above:

hogi_0-1739826787843.png

 

 

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Stack(
	columns( :height, :weight )
);
Graph Builder(
	Summary Statistic( "Median" ),
	Graph Spacing( 4 ),
	Variables(
		X( :age ),
		X( :Label, Position( 1 ) ),
		Y( :Data ),
		Overlay( :Label )
	),
	Elements(
		Points( X( 1 ), X( 2 ), Y, Legend( 11 ) ),
		Box Plot( X( 1 ), X( 2 ), Y, Legend( 12 ), Box Placement( "Align" ) )
	)
);


edit: to highlight the trick, I kept the height/weight information on the x axis.
in general a user will prefer to hide this info:

hogi_1-1739826883754.png

hogi_2-1739826894134.png

Françoise
Level V

Hi Hogi,

your solution is not ok for all cases.

 

capture 13: with box-plots on offset

 

capture 14: aligned.

 

see the graph on the right: you have 2 box-plots on top on each other with align.

 

best regardsCapture13.PNGCapture14.PNG

hogi
Level XII

the universal solution:

  1. use the split in addition on the x axis
  2. activate aligned box placement
  3. maybe: "stack" the data before plotting

did you apply step 3?
can you share a simple example based on a file from the samples directory.
I am sure that we will find a workaround that works for your data as well.

I also agree: it could be easier ...

Vball247
Level V

Thanks for the tip on the "align". That worked in our case. Had to do the align for both the boxplot and the contourplot.