Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
Level I

## Aligning Points plot with box plot (2 Y variables)

Hi,

I have what I think is a simple problem that I cant figure out. Help would be great.

I want to plot two parameters, say y1 and y2. I don't care for x, but ideally the proposed solution would be able to handle a variable on x.

I want to show box plots and points overlayed, however the box plot separates correctly (see image 1)

but the points stack in same column (see image 2),

resulting in an overlay graph like this (see image3).

How do I get it such that the points are separated like the box plots?

Just to reiterate - if you are plotting Y1 against some x, this works per obvious methods of selecting "add points". But since I have Y1 and Y2, it doesnt seem to work through normal methods.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User

## Re: Aligning Points plot with box plot (2 Y variables)

Try stacking the response columns via Tables > Stack.  You should then have 1 response column and another column with labels corresponding to the column names that were stacked.  If you put the new consolidated response column in Y and the Label column in X, you can get the box plots with the data overlayed.

Here's an example where I did this with the Thickness data in the sample data library.  I stacked all the Thickness columns and made this plot from the results:

This solution will still allow for other X-variables because you can nest other X-variables into the X drop zone, or use the Group X drop zone.

-- Cameron Willden
4 REPLIES 4
Highlighted
Super User

## Re: Aligning Points plot with box plot (2 Y variables)

Try stacking the response columns via Tables > Stack.  You should then have 1 response column and another column with labels corresponding to the column names that were stacked.  If you put the new consolidated response column in Y and the Label column in X, you can get the box plots with the data overlayed.

Here's an example where I did this with the Thickness data in the sample data library.  I stacked all the Thickness columns and made this plot from the results:

This solution will still allow for other X-variables because you can nest other X-variables into the X drop zone, or use the Group X drop zone.

-- Cameron Willden
Highlighted
Level III

## Re: Aligning Points plot with box plot (2 Y variables)

Just be aware that when you display outlier boxplots with points overlaid that the outlier points will be duplicated. If you uncheck the Outliers checkbox in the Box Plot controls, that will fix this issue.

Highlighted
Level I

## Re: Aligning Points plot with box plot (2 Y variables)

Thanks guys! This worked really easily!
Highlighted
Super User