cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

Graph builder: bug when dragging subplots

What inspired this wish list request? 

When the user changes the order of subplot in graph Builder tby dragging the label on the X or Y axis to another position, strange things happen:

https://community.jmp.com/t5/Discussions/Graph-Builder-settings-for-new-FrameBoxes/m-p/561610/highli...

 

In this example,

- dragging "height" on the Y axis to the top resets the colors (!!)

- dragging"height" on the X axis to the right does NOT reset the colors (? :) )

- just grabbing and releasing "height" on the X axis resets the colors (!!!)

 

 

In addition, when adding new subplots it's it is almost a gamble how the plot will look like:
The color/marker settings are cloned to new subplots, 
if variables are added via drag & drop 

- on the right of an existing X variable

- on the bottom of an existing Y variable

and the settings are not cloned if the new variables are added

- on the left of an existing X variable

- on the right of an existing Y variable

 

 

What is the improvement you would like to see? 

please fix the issue!

When a user changes the order of of subplots or adds new variables, some actions should take place on a plumbing layer such that on the porcelain layer  everything looks

 

Why is this idea important? 

1) When changing the order of subplots, every user expects that just the subplots change their position - nobody would expect that color settings change.

 

2) When a user adds variables to the x or y axis, there result should be predictable result. The result should be the same - regardless of wether you add the new variable on the left, on the right, on top or at the bottom of the existing variables.

 

 

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

gb = dt << Graph Builder(
		Size( 534, 496 ),
		Graph Spacing( 4 ),
		Variables( X( :height ), Y( :weight ), Color( :sex ) ),
		Elements( Points( X, Y, Legend( 9 ) ) )
	);
	
// change color/marker settings
scalebox = gb << xpath( "//ScaleBox[@charID=\!"400\!"]" );
scalebox << Legend Model( 9, Properties( 1, {Line Color( 0 ), Marker Size( 10 )}, Item ID( "M", 1 ) ) );

// add second Y variable
gb << add variable( {:height, Role( "Y" )} );

gb << add variable( {:weight, Role( "X" )} );

wait(2);
	
New Window( "Modal Dialog example",
	<<Type( "Modal Dialog" ),
	V List Box(
		Text Box( "Try to change the order of height and weight on the x and y axis by dragging either weight or height to the other side. Did the color change?"),
		Button Box( "OK" )
	)
);

 

 

 

2 Comments
hogi
Level XI

While playing around with this issue, I understand now better why Jmp behaves like this.

 

After running the script in the first post, the Source code of the Graph Builder Report looks like this:

Graph Builder(
	Variables(
		X( :height ),
		X( :weight ),
		Y( :weight ),
		Y( :height ),
		Color( :sex )
	),
	Elements( Position( 1, 1 ), Points( X, Y, Legend( 9 ) ) ),
	Elements( Position( 1, 2 ), Points( X, Y, Legend( 10 ) ) ),
	Elements( Position( 2, 1 ), Points( X, Y, Legend( 11 ) ) ),
	Elements( Position( 2, 2 ), Points( X, Y, Legend( 12 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				9,
				Properties(
					1,
					{Line Color( 0 ), Marker Size( 10 )},
					Item ID( "M", 1 )
				)
			)}
		)
	)
)

One can see that the first Subplot with Legend #9 has some special Line and Marker setting , the other Subplots (Legend #10-12) don't. So, the settings #9 are automatically "broadcasted" to the other subplots because they share the same Color column ant therefore the same legend entries.

This is because the setting was applied first and then the new subplots were generated. The same happens if the user changes the setting with just a single set of items in the legend:

hogi_0-1695455399729.png

Then the new setting is applied to all plots at once - and in the script the changes just appear for the first legend #.

If the user activates legend entries for each subplot he can change the subplots separately.

hogi_2-1695455589892.png

 

Let's switch now to another plot (the code below) and find out what happens. Here, every subplot has it's own formatting (no common color column) and when I take one of the subplot groups (one column on the Y axis) and drag it to another location, the other subplots keep their settings and just the moved subplots forget their settings.

This is an acceptable behavior (**) - because the column could also be dragged to a completely different location (later in the video: to the x axis). Then nobody would expects that the formatting could be copied.

At the end of the video, the column is placed back to the original position - and the plot looks different to how it looked before. This is somehow OK -  should be,  because we already accepted such a behavior (**) :)

It is just a bit surprising.

 

NB: To get the old plot back, one could press CTRL + Z, or while dragging the column, press ESC.

 

 

After understanding what's going on for the well-defined case one can understand better what's wrong with the first case. Here, when the user takes one of the columns and starts dragging it, the respective entries will disappear from the legend (if they were even there) which seems to shuffle a bit the color settings.

 

So, after understanding what is going on, one can somehow escape the issue. What remains is just the issue with the axis labels: Manual axe labels are mixed up when plotting multiple columns .
Depending on where the column is dropped, different axis labels are affected - which can be easily monitored for this example - by comparing the number on the axis and the axis label. They should always match.

 

dt = new table();
dt << add rows(1);
c1= dt << new column ("col1",Nominal,set each value (1));
c2= dt << new column ("col2",Nominal,set each value (2));
c3= dt << new column ("col3",Nominal,set each value (3));
c4= dt << new column ("col4",Nominal,set each value (4));
c5= dt << new column ("col5",Nominal,set each value (5));
c6= dt << new column ("col6",Nominal,set each value (6));

Graph Builder(
	Size( 330, 347 ),
	Show Control Panel( 0 ),
	Graph Spacing( 10 ),
	Variables(
		X( :col1 ),
		X( :col2 ),
		X( :col3 ),
		Y( :col6 ),
		Y( :col5 ),
		Y( :col4 )
	),
	Elements( Position( 1, 1 ), Points( X, Y, Legend( 7 ) ) ),
	Elements( Position( 1, 2 ), Points( X, Y, Legend( 1 ) ) ),
	Elements( Position( 1, 3 ), Points( X, Y, Legend( 2 ) ) ),
	Elements( Position( 2, 1 ), Points( X, Y, Legend( 8 ) ) ),
	Elements( Position( 2, 2 ), Points( X, Y, Legend( 3 ) ) ),
	Elements( Position( 2, 3 ), Points( X, Y, Legend( 4 ) ) ),
	Elements( Position( 3, 1 ), Points( X, Y, Legend( 9 ) ) ),
	Elements( Position( 3, 2 ), Points( X, Y, Legend( 5 ) ) ),
	Elements( Position( 3, 3 ), Points( X, Y, Legend( 6 ) ) ),
	SendToReport(
		Dispatch( {}, "400", ScaleBox,
			{Legend Model(
				7,
				Properties(
					0,
					{Line Color( 3 ), Marker( "Backslash" ),
					Marker Size( 30 )},
					Item ID( "col6", 1 )
				)
			), Legend Model(
				1,
				Properties(
					0,
					{Line Color( 38 ), Marker( "Filled Left Triangle" ),
					Marker Size( 30 )},
					Item ID( "col5", 1 )
				)
			), Legend Model(
				2,
				Properties(
					0,
					{Line Color( 36 ), Marker( "Slash" ), Marker Size( 30 )},
					Item ID( "col4", 1 )
				)
			), Legend Model(
				8,
				Properties(
					0,
					{Line Color( 3 ), Marker( "Filled Up Triangle" ),
					Marker Size( 30 )},
					Item ID( "col6", 1 )
				)
			), Legend Model(
				3,
				Properties(
					0,
					{Line Color( 38 ), Marker( "FilledCircle" ),
					Marker Size( 30 )},
					Item ID( "col5", 1 )
				)
			), Legend Model(
				4,
				Properties(
					0,
					{Line Color( 36 ), Marker( "Filled Down Triangle" ),
					Marker Size( 30 )},
					Item ID( "col4", 1 )
				)
			), Legend Model(
				9,
				Properties(
					0,
					{Line Color( 3 ), Marker( "Slash" ), Marker Size( 30 )},
					Item ID( "col6", 1 )
				)
			), Legend Model(
				5,
				Properties(
					0,
					{Line Color( 38 ), Marker( "Filled Right Triangle" ),
					Marker Size( 30 )},
					Item ID( "col5", 1 )
				)
			), Legend Model(
				6,
				Properties(
					0,
					{Line Color( 36 ), Marker( "Backslash" ),
					Marker Size( 30 )},
					Item ID( "col4", 1 )
				)
			)}
		),
		Dispatch( {}, "graph title", TextEditBox, {Set Text( "" )} ),
		Dispatch( {}, "X title", TextEditBox, {Set Text( "1" )} ),
		Dispatch( {}, "Y title", TextEditBox,
			{Set Text( "6" ), Rotate Text( "Horizontal" )}
		),
		Dispatch( {}, "Y 1 title", TextEditBox,
			{Set Text( "5" ), Rotate Text( "Horizontal" )}
		),
		Dispatch( {}, "Y 2 title", TextEditBox,
			{Set Text( "4" ), Rotate Text( "Horizontal" )}
		),
		Dispatch( {}, "X 1 title", TextEditBox, {Set Text( "2" )} ),
		Dispatch( {}, "X 2 title", TextEditBox, {Set Text( "3" )} )
	)
)

 

hogi
Level XI

A common application: use the same color settings for all graphs (M=blue, F=pink).

This can be easily achieved via the Column Property: Value Colors.

 

In Jmp 17-17.2  it is not possible to use Value Colors as Color in Graph Builder for >1 subplot:

Graph Builder: Color not working for multiple Y axes 

 

Once this issue is fixed, using Value Colors will be again the easiest = best solution:)

By the way: The Color, Marker, ... settings via the legend are one of a few settings which actually have a functionality to auto-adjust to the new layout when subplots are moved, added or removed.