cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use JMP Live to centralize and share reports within groups. Webinar with Q&A April 4, 2pm ET.
Choose Language Hide Translation Bar
View Original Published Thread

How can align the points inside their respective boxes in Box plot (when an overlay is applied)

HV0508
Level III

How can align the points inside their respective boxes in Box plot (when an overlay is applied)

HV0508_0-1740590424527.png



i have a data where group x is one column lets say A , and on overlay there is another column lets say B .
Is there any option that the points can be aligned in their respective boxes?

Below is my code - 

createBoxPlot = Function({dt, cols},
	Show("Using Columns for Box Plot:", cols);

// Create Dashboard with Box Plots
	New Window("Analysis Dashboard",
		Tab Box(
			"Box Plots",
			V List Box(
				Text Box("Box Plot by A, B"),
				For(i = 1, i <= N Items(cols), i++,
					gb = Graph Builder(
						Size(800, 500),
						Show Control Panel(0),
						Variables(X(:C), Y(As Column(cols[i])), Group X(:A), Overlay(:B)),
						Elements(Box Plot(X, Y, Legend(4)), Points(X, Y, Legend(5)))
					)
				)
			)
		)
	);
);
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User


Re: How can align the points inside their respective boxes in Box plot (when an overlay is applied)

Could one of your columns be continuous? They need to be categorical (nominal/ordinal) for this type of plotting

-Jarmo

View solution in original post

9 REPLIES 9
jthi
Super User


Re: How can align the points inside their respective boxes in Box plot (when an overlay is applied)

Try using Align placement for your box plots (right click on graph)

jthi_0-1740590918256.png

 

-Jarmo
HV0508
Level III


Re: How can align the points inside their respective boxes in Box plot (when an overlay is applied)

I tried that but it overlaps the two overlay variable boxes like below - 

HV0508_0-1740594427694.png

I was wondering if i can have them side by side as in the description of this issue ,along with the points inside their respective boxes.

jthi
Super User


Re: How can align the points inside their respective boxes in Box plot (when an overlay is applied)

HV0508
Level III


Re: How can align the points inside their respective boxes in Box plot (when an overlay is applied)

I tried this as well but it forms like this - 

HV0508_0-1740595747991.png

 



jthi
Super User


Re: How can align the points inside their respective boxes in Box plot (when an overlay is applied)

As I don't have your data I'm going with a bit of guessing based on your script. I won't have X Group in my graph, it might matter or not

 

We start from this

jthi_0-1740596034569.png

 

Then we move our overlay to X-Axis (you can hide the labels if needed)

jthi_1-1740596063379.png

And finally we add that same column to color

jthi_2-1740596085136.png

 

So we are not utilizing Overlay in this case which can be an issue with your data or with what you are trying to plot

-Jarmo
HV0508
Level III


Re: How can align the points inside their respective boxes in Box plot (when an overlay is applied)

Why for you in the X axis you can see both age as well as sex values for me it is kind of different .

HV0508_0-1740597270339.png

What am i doing wrong , I wonder

jthi
Super User


Re: How can align the points inside their respective boxes in Box plot (when an overlay is applied)

Could one of your columns be continuous? They need to be categorical (nominal/ordinal) for this type of plotting

-Jarmo
HV0508
Level III


Re: How can align the points inside their respective boxes in Box plot (when an overlay is applied)

Oh yes ,You caught it right. Let me try it now.

HV0508
Level III


Re: How can align the points inside their respective boxes in Box plot (when an overlay is applied)

It worked . Thankyou so much

Recommended Articles

No recommendations found