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
hogi
Level XIII

Some Tricks with Parallel Y Axes

The main idea behind the new parallel Y-axes setting is to generate overlays of plots with several axes on the left, as shown in  New in Graph Builder for JMP 19 


The same principle applies if some axes are on the right of the graph, e.g. for  1 axis on the left and 1 axis right:

Open( "$SAMPLE_DATA/Functional Data/Anodic Bond.jmp" );
Graph Builder(
//	Parallel Axes( "Y Only" ),
	Variables( X( :Order ), Y( :Piston Force ), Y( :Charge, Position( 1 ), Side( "Right" ) ) ),
	Elements( Line( X, Y( 1 ) ), Line( X, Y( 2 ) ) ),
	Local Data Filter(
		Add Filter(
			columns( :Wafer Id ),
			Where( :Wafer Id == 11 )
		)
	)
);

uncomment Parallel Axes( "Y Only" ) and the new functionality will help you to get the right colors:

hogi_0-1762966313855.png

 

more fun: multiple values on the left and right side:

hogi_0-1762965463034.png

 

Graph Builder(
	Parallel Axes( "Y Only" ),
	Variables(
		X( :Order ),
		Y( :Flow ),
		Y( :Voltage, Position( 1 ), Side( "Right" ) ),
		Y( :Piston Force ),
		Y( :Charge, Position( 2 ), Side( "Right" ) )
	),
	Elements( Position( 1, 1 ), Line( X, Y( 1 ) ), Line( X, Y( 2 ) ) ),
	Elements( Position( 1, 2 ), Line( X, Y( 1 ) ), Line( X, Y( 2 ) ) ),
	Local Data Filter(
		Add Filter(
			columns( :Wafer Id ),
			Where( :Wafer Id == 11 ),
			Display( :Wafer Id, N Items( 15 ), Find( Set Text( "" ) ) )
		)
	)
);



remove the Parallel Axes( "Y Only" ) to see how the graph is generated:
note that the different traces have to be in separate graphs at first (e.g. Flow and Piston Force fo the left side)  - 
rather than being merged into the same graph. 

The same logic holds for "all parallel axes on the left":
Do not merge the traces into the same graph yourself; first, they must be in different graphs on top of each other.
As soon as the user activates Parallel Axes , it's JMP who will merge the traces - and split the axes.

Expert mode: Let's see what happens when a user merges 2 traces into the same graph (and adds some other traces on top) ...
After activating Parallel Axes, the 2 merged traces will use the same axis while the other traces get their own axis.

I hope this explanation helps you to understand the general logic.

hogi_1-1762965521387.png


"Y Only"?


so, there will be "X only" and "X and Y" as well ? - but maybe in a next version of JMP ...



side discussion of DACH Users Group Treffen 2025 - Eindrücke und Ressourcen  / JMP19 -- JMP Wishlist 

9 REPLIES 9
XanGregg
Staff

Re: Some Tricks with Parallel Y Axes

Nice exposition, @hogi . It did start out as an X and/or Y feature, but we never found any X uses and it didn't seem worth the extra effort.

hogi
Level XIII

Re: Some Tricks with Parallel Y Axes

"Only X"
here is a wish in the wish list. Maybe not exactly "Parallel X Axes" *) - but closely linked to it 
Secondary x-axis in Graph Builder  by @Morten 

hogi_0-1762971225663.png

*) the secondary x axis could be placed at the opposite side of the graph.

In dependent of the location of the secondary X axis, I can think of 2 distinct application cases for the secondary x axis:

  • 2 overlayed graphs, using individual / separate x-axes
    (analogous the existing behavior for  different Y axes)


  • a single graph with a fixed, "physical" / mathematical link between the first and the secondary axis labels *)
    e.g.
    - 1/T [K] + T[°C]
    - wavelength in nm  + wavelength in 1/cm
    - deviation in % + factors of sigma:
    hogi_1-1762971716064.png

*) With Parallel Axes( "X Only" )available,  the user will be able to create the linked X axes by adding a secondary axis without a graph - and then manually adjusting the scale and offset to match the values of both axes. A mathematically correct/fixed link will be more professional - but also much more complicated to define, especially for complicated links (= the most interesting application cases) like X and 1/X and percent and factors of sigma. I guess most users will be happy with the first (manual) option.

edit:
**) With Parallel Axes( "Y Only" )available in JMP19, the user can create a fake graph with linked X axes:
... by creating a graph with manually "linked" Y axes and rotating the graph by 90° (see below)

***) With JMP19 and below, the user can create a fake graph with linked X axes: top & bottom
by creating a graph with manually "linked" left and right Y axes and rotating the graph by 90° (see below)


"X and Y"?
-> better to NOT have it ; )
I remember a meeting where a colleague used such a graph – it's soooo difficult for the human brain to combine the right dimensions!
This approach might save space in the presentation, but it wastes meeting time on discussions about the axes.

hogi
Level XIII

Re: Some Tricks with Parallel Y Axes

even [boring] linear factors could be an application case - to produce plots that can be used in different regions of the world:

- inch + cm

- €  + $

- MDY +  DMY   [just kidding]

- ...

hogi
Level XIII

Re: Some Tricks with Parallel Y Axes

and here the ultimate use case:
log (seconds) + everyday timescales
... for aging plots which are physically correct - and easy to interpret.

hogi_0-1762985293931.png

hogi
Level XIII

Re: Some Tricks with Parallel Y Axes

hogi
Level XIII

Re: Some Tricks with Parallel Y Axes

This is a toy script to play with the features:

Open( "$SAMPLE_DATA/Reliability/GaAs Laser.jmp" );

gb = Graph Builder(
	Size( 542, 598 ),
	Show Legend( 0 ),
	Parallel Axes( "Y Only" ),
	Graph Spacing( 4 ),
	Variables( X( :Current ), Y( :Hours, Side( "Right" ) ), Y( :Hours, Side( "Right" ) ), Overlay( :Batch ) ),
	Elements( Position( 1, 1 ), Points( X, Y, Legend( 45 ) ) ),
	Elements( Position( 1, 2 ), Smoother( X, Y, Legend( 44 ) ) ),
	SendToReport(
		Dispatch( {}, {:Current}, ScaleBox, {Label Row( Label Orientation( "Vertical" ) )} ),
		Dispatch( {}, "", ScaleBox,
			{Label Row(
				{Automatic Tick Marks( 0 ), Show Major Grid( 0 ), Show Major Labels( 0 ), Show Major Ticks( 0 ),
				Show Minor Ticks( 0 )}
			)}
		),
		Dispatch( {}, "", ScaleBox( 2 ),
			{Label Row(
				{Automatic Tick Marks( 0 ), Show Major Grid( 0 ), Show Major Labels( 0 ), Show Major Ticks( 0 ),
				Show Minor Ticks( 0 )}
			)}
		),
		Dispatch( {}, {:Hours}, ScaleBox,
			{Scale( "Log" ), Min( 10 ), Max( 10000 ), Inc( 1 ), Minor Ticks( 1 ),
			Add Ref Line( 24, "Solid", "Black", "day", 1 ), Add Ref Line( 168, "Solid", "Black", "week", 1 ),
			Add Ref Line( 720, "Solid", "Black", "month", 1 ), Add Ref Line(
				2160, "Solid", "Black", "quarter", 1
			), Label Row(
				{Label Orientation( "Vertical" ), Show Major Grid( 0 ), Show Major Labels( 0 ),
				Show Major Ticks( 0 ), Show Minor Labels( 0 ), Show Minor Ticks( 0 )}
			)}
		),
		Dispatch( {}, {:Hours}, ScaleBox( 2 ),
			{Scale( "Log" ), Min( 10 ), Max( 10000 ), Minor Ticks( 1 ),
			Label Row( {Label Orientation( "Vertical" ), Show Minor Grid( 1 ), Show Minor Labels( 0 )} )}
		),
		Dispatch( {}, {:Hours, "Y title"}, TextEditBox, {Rotate Text( "Left" )} ),
		Dispatch( {}, {:Hours, "Y 1 title"}, TextEditBox, {Rotate Text( "Left" )} )
	)
);

report(gb)[GraphBuilderBox(1)] << save picture( "$TEMP/graph.png", "png" );
img = Open( "$TEMP/graph.png", "png" );
img << rotate(90) << scale(0.5);
New window("graph", img)

It creates a plot with a Secondary "X" axis in Graph Builder  :

hogi_2-1763143613643.png

 

  • ... actually, not a real "X" axis - it's a Y axis and the plot is rotated
    (please notice the wrong orientation of the Y axis label)

  • why is the x axis blue?
    This is a conflict between "Parallel Axes" and Overlay.
    why just parts of the axes? I don't know.

Actually, it's better to switch off the parallel axes and use labels on opposite sides of the plot.
I really like this mode — if it were available for the X-axis, I would use it quite often.

hogi_4-1763143970446.png

gb = Graph Builder(
	Size( 530, 473 ),
	Graph Spacing( 4 ),
	Show Legend( 0 ),
	Variables(
		X( :Current ),
		Y( :Hours ),
		Y( :Hours, Position( 1 ), Side( "Right" ) ),
		Group X( :Batch, Show Title( 0 ) )
	),
	Elements( Smoother( X, Y( 1 ), Legend( 40 ) ), Points( X, Y( 2 ), Legend( 41 ) ) ),
	SendToReport(
		Dispatch( {}, {:Hours}, ScaleBox,
			{Scale( "Log" ), Min( 10 ), Max( 10000 ), Inc( 1 ), Minor Ticks( 1 ),
			Add Ref Line( 24, "Solid", "Black", "day", 1 ), Add Ref Line( 168, "Solid", "Black", "week", 1 ),
			Add Ref Line( 720, "Solid", "Black", "month", 1 ), Add Ref Line(
				2160, "Solid", "Black", "quarter", 1
			), Label Row(
				{Label Orientation( "Vertical" ), Show Major Grid( 0 ), Show Major Labels( 0 ),
				Show Major Ticks( 0 ), Show Minor Labels( 0 ), Show Minor Ticks( 0 )}
			)}
		),
		Dispatch( {}, {:Hours}, ScaleBox( 2 ),
			{Scale( "Log" ), Min( 10 ), Max( 10000 ), Minor Ticks( 1 ),
			Label Row( {Label Orientation( "Vertical" ), Show Minor Grid( 1 ), Show Minor Labels( 0 )} )}
		),
		Dispatch( {}, {:Hours, "Y title"}, TextEditBox, {Set Text( "" )} ),
		Dispatch( {}, {:Hours, "Y r title"}, TextEditBox, {Rotate Text( "Left" )} )
	)
);

One could argue that for this "label mode"  it's much easier to use "opposite side" in the reference line menu to get the labels there :

hogi_6-1763144332684.png

 

But everybody hates the "clones" that show up with this mode:

hogi_7-1763144397373.png

hogi
Level XIII

Re: Some Tricks with Parallel Y Axes


@hogi wrote:

... conflict between "Parallel Axes" and Overlay.


 

This conflict is also present in the current mode - and thereby reduces the number of possible application cases.
With Parallel Axes activated, when the user activates Overlay as well, overlay controls the color and the colors of all parameters get synchronized (visible by the same color of the axis labels).

 

hogi_0-1763152821104.png

 

 

Open( "$SAMPLE_DATA/Functional Data/Anodic Bond.jmp" );
Graph Builder(
	Size( 957, 548 ),
	Parallel Axes( "Y Only" ),
	Graph Spacing( 4 ),
	Variables( X( :Order ), Y( :Flow ),  Y( :Voltage ), Overlay( :Wafer Id ) ),
	Elements( Position( 1, 1 ), Line( X, Y ) ),
	Elements( Position( 1, 2 ), Line( X, Y) ),
	Local Data Filter(
		Add Filter(
			columns( :Wafer Id ),
			Where( :Wafer Id == {8, 9, 10, 11} ),
			Display( :Wafer Id, N Items( 15 ), Find( Set Text( "" ) ) )
		)
	)
);

 

 

the trick: Use Overlay Encoding = Style, 

 hogi_1-1763152870878.png

and assign different colors to all curves for the same parameter:

hogi_2-1763153068095.png

As this has to be done manually, this can take forever. An easy trick: use  Graph Builder Toolbar / Graph builder remote control  from the market place:




Another Trick: open the legend menu, select a bock of legend entries and apply the color via right click.
[when you try the same in the legend itself, the new color will be assigned to all parameters]hogi_3-1763153473358.png

 

hogi
Level XIII

Re: Some Tricks with Parallel Y Axes

By the way, why did the user select the entries one by one and not (*):

  • Select the first entry of the block?
  • Press Shift.
  • Select the last entry of the block.

Due to a bug in the legend menu (TS-00168563), the first entry is deselected when the last entry is selected. Therefore, after selecting the entries via (*), the user has to select the first entry again. Selecting the entries one by one takes a similar amount of time for four entries. 

hogi
Level XIII

Re: Some Tricks with Parallel Y Axes

-> link added to Tiny Traps in Jmp and JSL 

Recommended Articles