cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
eranse
Level II

side by side bar graph with 2 y

Hi,

I am trying to create a bar graph with 2 y axis.  but whenever i move a column to the right to create the second axis - the bars become almost nested and I can't separate them.

eranse_1-1586935373598.jpeg

 

eranse_0-1586935310515.jpeg

I would like the bars to be separate as in the first graph but with the 2 different axis.

Seems like something very basic that I am missing -what is it?

Thanks,

Eran

5 REPLIES 5
Thierry_S
Super User

Re: side by side bar graph with 2 y

Hi Eran,
It seems to be a glitch: I'm working with JMP 14.1 and I too cannot figure out how to restore the proper bar lineup with 1 or 2 variables on the Left Y axis and 1 variable on the Right Y axis. Maybe a more seasoned JMP user could provide a suggestion
Thierry R. Sornasse
eranse
Level II

Re: side by side bar graph with 2 y

Hi Thierry,
I thought that in a previous JMP14 version it did work - and only recently encountered this when I tried to do it in the current Jmp15.1.0
I guess it is a glitch and hope it's fixed soon.
Eran
Thierry_S
Super User

Re: side by side bar graph with 2 y

Hi Eran,

I just checked the same graph options in JMP 13.1 and I have same problem

Best,

TS
Thierry R. Sornasse
gzmorgan0
Super User (Alumni)

Re: side by side bar graph with 2 y

Hi @eranse ,

I am guessing you want a second axis because the magnitude of Column 3 is so much larger that Columns 2 and 4. However, in my opinion, a two axis bar chart is fraught with the risk of misinterpretation: a bar with a value of 90 next to a bar with about the same height and a value 340 is jarring.  I think two axis plots can be useful to show data trends with lines, and even then only if the axes are colored to match the curves, etc. 

 

Since the GraphBuilder platform is not producing what you need, I am suggesting an alternative plot

image.png

Graph Builder(
	Size( 763, 517 ),
	Show Control Panel( 0 ),
	Graph Spacing( 10 ),
	Variables( X( :Column 1 ), Y( :Column 4 ), Y( :Column 2 ), Y( :Column 3 ) ),
	Elements(
		Position( 1, 1 ),
		Bar( X, Y, Legend( 9 ), Label( "Label by Value" ) )
	),
	Elements(
		Position( 1, 2 ),
		Bar( X, Y, Legend( 8 ), Label( "Label by Value" ) )
	),
	Elements(
		Position( 1, 3 ),
		Bar( X, Y, Legend( 7 ), Label( "Label by Value" ) )
	),
	SendToReport(
		Dispatch( {}, "Graph Builder", OutlineBox, {Select} ),
		Dispatch( {}, "Column 4", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
		Dispatch( {}, "Column 2", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
		Dispatch( {}, "Column 3", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
		Dispatch(
			{},
			"Y title",
			TextEditBox,
			{Set Font Size( 12 ), Set Font Style( "Bold" ), Font Color( 53 )}
		),
		Dispatch(
			{},
			"Y 1 title",
			TextEditBox,
			{Set Font Size( 12 ), Set Font Style( "Bold" ), Font Color( 19 )}
		),
		Dispatch(
			{},
			"Y 2 title",
			TextEditBox,
			{Set Font Size( 12 ), Set Font Style( "Bold" ), Font Color( 20 )}
		),
		Dispatch(
			{},
			"400",
			LegendBox,
			{Legend Position( {9, [1], 8, [0], 7, [2]} ), Position( {1, 0, 2} )}
		)
	)
)

However, I can create the graph you want (that I do not like). It requires restructuring your data. See the attached journal that creates the data table and this graph.

image.png

 

"Just because you can, doesn't mean you should."

eranse
Level II

Re: side by side bar graph with 2 y

Thanks,

I understand the potential problem with a graph with different y scales, but it is helpful to show the direction of the data, and I am not certain that placing the information on different graphs is always better.

Thank you for the solution - it does solve it perfectly.

 

Best,

Eran