cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
LS35A
Level I

How do I selectively turn off parameters on the X-axis on different graph plots on the same graph

I have 5 different plots that appear on the same graph using the same common X-axis for all 5 plots but I would like to selectively turn on and display only the parameters on the X-axis that are applicable (and turn off the rest that are not) to the respective plot.  How do I do that?

 

LS35A_0-1768607410356.png

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
hogi
Level XIII

Re: How do I selectively turn off parameters on the X-axis on different graph plots on the same graph

There are several workarounds, every one with it's own drawbacks.

The "easiest" one:  nest the nominal values on the X axis
the variable that splits the data into 5 blocks - remove it from X Group  and drag it below the current X axis to create a nested view.

The huge drawback: 
the clear separation of the 5 blocks is gone.
To fix this issue, there is another wish: 

optimized graphics settings for nested X categories 

 

original plot:
distinct blocks - but a lot of white space

hogi_0-1768646863949.png

View more...
Open( "$SAMPLE_DATA/US Demographics.jmp" );
Graph Builder(
	Variables( X( :State ), Y( :Population ), Group X( :Region ), Color( :Region ) ),
	Elements( Bar( X, Y ) )
);

 

nested X:
no empty x labels - but blocks are lost

hogi_1-1768646894934.png

edit: video added

View solution in original post

txnelson
Super User

Re: How do I selectively turn off parameters on the X-axis on different graph plots on the same graph

To do what you want to do, I believe you will need to create 5 X axis columns. Only filling in the  Measurement Location in the X axis column for plot the data are for.  To illustrate what I am talking about, I have taken the Big Class data table and modified it to produce the following Graph.

txnelson_2-1768675592429.png

 

The graph shows 2 plots.  One for Females and one for Males.  In the modified data table there are no 12 or 17 year old females while there are no 13 or 16 year old males.   

To allow for the X axis to have unique values for each plot, there needs to be separate X columns for each plot.  In my example, which has 2 plots, I created 2 columns that has the values for age.

 

txnelson_3-1768675660196.png

Then all that has to be done to get the graph you want, is to drag each of the separate X columns to the X drop area, placing them side by side on the axis.

Finally, I left the original Age column in the data table, which allowed me to drag it to the Color drop box, which not only colored the box plots, but also created a Legend

Jim

View solution in original post

10 REPLIES 10
txnelson
Super User

Re: How do I selectively turn off parameters on the X-axis on different graph plots on the same graph

Without seeing Graph Builder Control Panel,  it is hard to see the data structure to determine if your measurement data are all in one column and you are using an Overlay to separate the data, or if your 5 plots are coming from 5 different columns. If the data are all in one column, you can use a Local Data Filter to select just the data you want displayed.  If the data are in 5 separate columns, you night be able to use a Column Switcher to select which column to display.  In this latter case, you could also stack the 5 columns and then use the Local Data Filter.

 

A sample data table, and an image of the full graph with it's control panel would be helpful.

Jim
hogi
Level XIII

Re: How do I selectively turn off parameters on the X-axis on different graph plots on the same graph

With some guessing, the 5 graphs are generated by splitting the data via X Group.
Then you experience a problem that is very common in JMP / Graph Builder.

Fortunately, developers are aware of the issue and nominated the topic as candidate of last years's Prioritization Survey:

hogi_0-1768643823422.png

Help shape the future of JMP: Take this year’s Wish List Prioritization Survey! 

If enough users voted in 2025, there's a good chance it'll be fixed soon.
 @Sarah-Sylvestre , when will the analysis of the Survey be available.
Can you tell us which place   X group: restrict the values on the axis to the respective group  made?

hogi
Level XIII

Re: How do I selectively turn off parameters on the X-axis on different graph plots on the same graph

There are several workarounds, every one with it's own drawbacks.

The "easiest" one:  nest the nominal values on the X axis
the variable that splits the data into 5 blocks - remove it from X Group  and drag it below the current X axis to create a nested view.

The huge drawback: 
the clear separation of the 5 blocks is gone.
To fix this issue, there is another wish: 

optimized graphics settings for nested X categories 

 

original plot:
distinct blocks - but a lot of white space

hogi_0-1768646863949.png

View more...
Open( "$SAMPLE_DATA/US Demographics.jmp" );
Graph Builder(
	Variables( X( :State ), Y( :Population ), Group X( :Region ), Color( :Region ) ),
	Elements( Bar( X, Y ) )
);

 

nested X:
no empty x labels - but blocks are lost

hogi_1-1768646894934.png

edit: video added

hogi
Level XIII

Re: How do I selectively turn off parameters on the X-axis on different graph plots on the same graph

Far from "easy": via Page

distinct blocks, no unnecessary white space
but quite some effort to get the labels right

hogi_2-1768647209655.png

 

LS35A
Level I

Re: How do I selectively turn off parameters on the X-axis on different graph plots on the same graph

Hi Hogi,

Thanks for your response to my question.  Per your reply: "The "easiest" one:  nest the nominal values on the X axis the variable that splits the data into 5 blocks - remove it from X Group  and drag it below the current Y axis to create a nested view."  Can you please show me step by step how to achieve  that?  Thanks.

LS35A
Level I

Re: How do I selectively turn off parameters on the X-axis on different graph plots on the same graph

I think I managed to do what you suggested by playing around with dragging the X-axis parameters.  Thanks again for your suggestions.

hogi
Level XIII

Re: How do I selectively turn off parameters on the X-axis on different graph plots on the same graph

Sometimes the values on the X axis are just use to create distinct box plots.
... and there is no need to have the exact labels on the X axis.

 

For this case, a new solution is available in JMP19:
- Col Score 
- in combination with scoping

The idea:

- convert the "label" to (overlapping) numbers
- for each block, start with 1
[- optional: use color to make the individual builds / states / ... accessible]

hogi_2-1768727113756.png

 

 

Open( "$SAMPLE_DATA/US Demographics.jmp" );
Graph Builder(
	Transform Column(
		"Score Unique[State]@Graph",
		Nominal,
		Formula( Col Score( :State, :"@Graph"n ) )
	),
	Variables(
		Y( :Population ),
		Group X( :Region ),
		Overlay( :"Score Unique[State]@Graph"n ),
		Color( :State )
	),
	Elements( Bar( Y ) )
);

 

LS35A
Level I

Re: How do I selectively turn off parameters on the X-axis on different graph plots on the same graph

Hi Jim,

Thanks so much for taking the time to respond to my query.  The data are in one column named 'Gap Location' though the 5 plots represent 5 different locations unrelated to each other, please see screenshot below. I tried dragging the X-axis to hide the unrelated parameters but doing that resulted in all the remaining 4 plots showing the same X-axis.  Thanks again for your advice.  

LS35A_0-1768669544048.png

 

txnelson
Super User

Re: How do I selectively turn off parameters on the X-axis on different graph plots on the same graph

To do what you want to do, I believe you will need to create 5 X axis columns. Only filling in the  Measurement Location in the X axis column for plot the data are for.  To illustrate what I am talking about, I have taken the Big Class data table and modified it to produce the following Graph.

txnelson_2-1768675592429.png

 

The graph shows 2 plots.  One for Females and one for Males.  In the modified data table there are no 12 or 17 year old females while there are no 13 or 16 year old males.   

To allow for the X axis to have unique values for each plot, there needs to be separate X columns for each plot.  In my example, which has 2 plots, I created 2 columns that has the values for age.

 

txnelson_3-1768675660196.png

Then all that has to be done to get the graph you want, is to drag each of the separate X columns to the X drop area, placing them side by side on the axis.

Finally, I left the original Age column in the data table, which allowed me to drag it to the Color drop box, which not only colored the box plots, but also created a Legend

Jim

Recommended Articles