cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

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

3 Y-axes with 3 different elements

I'm trying to recreate this GC metric chart from Picard in JMP but am having trouble figuring out how to get 3 different Y-axes that all have different elements.  Here is the graph I am trying to make: 

KScott_0-1764167487851.png

This is as far as I have gotten. I added the base quality to the y axis and then moved it to the right to get two Y-axes but can't figure out how to add in the red histogram as well. 

KScott_1-1764167661305.png

I've attached the data with the script I have so far. I'd prefer a non-coding answer if possible and am using JMP 19. Thanks so much for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: 3 Y-axes with 3 different elements

Create range 0-1 from your windows at GC%

jthi_0-1764170165311.png

Add that new column to your Y-axis.

Add bar chart to your graph and disable variables from points/bar accordingly

jthi_1-1764170236364.png

View more...
Graph Builder(
	Size(730, 719),
	Show Control Panel(0),
	Variables(
		X(:GC% of 100 base windows),
		Y(:Mean base quality, Side("Right")),
		Y(:Fraction of normalized coverage, Position(1)),
		Y(:"Range Scale[Windows at GC%]"n, Position(1))
	),
	Elements(
		Points(X, Y(2), Legend(16)),
		Line(X, Y(1), Legend(18)),
		Bar(X, Y(3), Legend(29))
	),
	SendToReport(
		Dispatch({}, "GC% of 100 base windows", ScaleBox,
			{Min(-2.43663303909206), Add Ref Line(50, "Solid", "Black", "", 1)}
		),
		Dispatch({}, "Fraction of normalized coverage", ScaleBox,
			{Format("Fixed Dec", 12, 1), Min(-0.0597014925373134), Max(2), Inc(0.5),
			Minor Ticks(1), Add Ref Line(1, "Solid", "Black", "", 1)}
		),
		Dispatch({}, "Mean base quality", ScaleBox,
			{Format("Best", 12), Min(-1.21054871739173), Max(40.0924512083527),
			Inc(10), Minor Ticks(1)}
		),
		Dispatch({}, "400", ScaleBox,
			{Legend Model(
				16,
				Type Properties(0, "Marker", {Line Color(5), Marker("Circle")}),
				Properties(
					0,
					{Line Color(5), Marker("Circle")},
					Item ID("Fraction of normalized coverage", 1)
				),
				Properties(
					-1,
					{Line Color(5), Marker("Circle")},
					Item ID("Range Scale[Windows at GC%]", 1)
				),
				Properties(
					-1,
					{Line Color(5), Marker("Circle")},
					Item ID("Normalized_Coverage", 1)
				),
				Properties(-1, {Fill Color(35)}, Item ID("WINDOWS", 1)),
				Properties(
					-1,
					{Line Color(5), Marker("Circle")},
					Item ID("NORMALIZED_COVERAGE", 1)
				),
				Properties(
					-1,
					{Line Color(5), Marker("Circle")},
					Item ID("Windows at GC%", 1)
				)
			), Legend Model(
				18,
				Type Properties(0, "H Line", {Line Color(4)}),
				Properties(0, {Line Color(4)}, Item ID("Mean base quality", 1)),
				Properties(-1, {Line Color(4)}, Item ID("Base_Quality", 1))
			)}
		)
	)
);

Or you could add two y-axis and use Parallel Y Axes

jthi_2-1764170419821.png

and similarly tinker with enable/disable variables until you get what you wish

jthi_3-1764170657299.png

 

-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: 3 Y-axes with 3 different elements

Create range 0-1 from your windows at GC%

jthi_0-1764170165311.png

Add that new column to your Y-axis.

Add bar chart to your graph and disable variables from points/bar accordingly

jthi_1-1764170236364.png

View more...
Graph Builder(
	Size(730, 719),
	Show Control Panel(0),
	Variables(
		X(:GC% of 100 base windows),
		Y(:Mean base quality, Side("Right")),
		Y(:Fraction of normalized coverage, Position(1)),
		Y(:"Range Scale[Windows at GC%]"n, Position(1))
	),
	Elements(
		Points(X, Y(2), Legend(16)),
		Line(X, Y(1), Legend(18)),
		Bar(X, Y(3), Legend(29))
	),
	SendToReport(
		Dispatch({}, "GC% of 100 base windows", ScaleBox,
			{Min(-2.43663303909206), Add Ref Line(50, "Solid", "Black", "", 1)}
		),
		Dispatch({}, "Fraction of normalized coverage", ScaleBox,
			{Format("Fixed Dec", 12, 1), Min(-0.0597014925373134), Max(2), Inc(0.5),
			Minor Ticks(1), Add Ref Line(1, "Solid", "Black", "", 1)}
		),
		Dispatch({}, "Mean base quality", ScaleBox,
			{Format("Best", 12), Min(-1.21054871739173), Max(40.0924512083527),
			Inc(10), Minor Ticks(1)}
		),
		Dispatch({}, "400", ScaleBox,
			{Legend Model(
				16,
				Type Properties(0, "Marker", {Line Color(5), Marker("Circle")}),
				Properties(
					0,
					{Line Color(5), Marker("Circle")},
					Item ID("Fraction of normalized coverage", 1)
				),
				Properties(
					-1,
					{Line Color(5), Marker("Circle")},
					Item ID("Range Scale[Windows at GC%]", 1)
				),
				Properties(
					-1,
					{Line Color(5), Marker("Circle")},
					Item ID("Normalized_Coverage", 1)
				),
				Properties(-1, {Fill Color(35)}, Item ID("WINDOWS", 1)),
				Properties(
					-1,
					{Line Color(5), Marker("Circle")},
					Item ID("NORMALIZED_COVERAGE", 1)
				),
				Properties(
					-1,
					{Line Color(5), Marker("Circle")},
					Item ID("Windows at GC%", 1)
				)
			), Legend Model(
				18,
				Type Properties(0, "H Line", {Line Color(4)}),
				Properties(0, {Line Color(4)}, Item ID("Mean base quality", 1)),
				Properties(-1, {Line Color(4)}, Item ID("Base_Quality", 1))
			)}
		)
	)
);

Or you could add two y-axis and use Parallel Y Axes

jthi_2-1764170419821.png

and similarly tinker with enable/disable variables until you get what you wish

jthi_3-1764170657299.png

 

-Jarmo
KScott
Level I

Re: 3 Y-axes with 3 different elements

Perfect, thank you!

Recommended Articles