cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
hogi
Level XII

jsl code to change the "view" for a graph builder plot with X grouping?

Hi,

the "group X" option generates 2 plots, one for "F" and one for "M".

The option "First View Level" can be used to specify which "view" to start with , here:  "M" (2nd view).

is there a JSL code to prgrammatically change the "view", something like

 

gr << Set X View Level (1)

 

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


gr = dt << Graph Builder(
	Variables( X( :height ), Y( :weight ), Group X( :sex, N View Levels( 1 ),First View Level( 2 ) ) ),
	Elements( Points( X, Y, Legend( 20 ) ), Smoother( X, Y, Legend( 21 ) ) )
);

The idea:
- selection of a data point is (in another graph) triggers the plot to show the respective subgroup
- the user still has the possibility to go to another subgroup

- in the giu, "X group" is much small than a local data filter

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: jsl code to change the "view" for a graph builder plot with X grouping?

I'm not sure if this is only method, but you might have to manipulate Variables.

Here is one example, it first adds new grouping variable and then deletes variable in index 3 which in this case is the "old" grouping.

Names Default To Here(1);

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

gb = dt << Graph Builder(
	Variables(X(:height), Y(:weight), Group X(:sex, N View Levels(1), First View Level(2))),
	Elements(Points(X, Y, Legend(20)), Smoother(X, Y, Legend(21)))
);

gbb = Report(gb)[Graph Builder Box(1)];
wait(2);
//gbb << get variables;
gbb << Add Variable({:sex, Role("Group X"), Position(1), N View Levels(1), First View Level(1)});
gbb << Remove Variable(3);

 

-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: jsl code to change the "view" for a graph builder plot with X grouping?

I'm not sure if this is only method, but you might have to manipulate Variables.

Here is one example, it first adds new grouping variable and then deletes variable in index 3 which in this case is the "old" grouping.

Names Default To Here(1);

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

gb = dt << Graph Builder(
	Variables(X(:height), Y(:weight), Group X(:sex, N View Levels(1), First View Level(2))),
	Elements(Points(X, Y, Legend(20)), Smoother(X, Y, Legend(21)))
);

gbb = Report(gb)[Graph Builder Box(1)];
wait(2);
//gbb << get variables;
gbb << Add Variable({:sex, Role("Group X"), Position(1), N View Levels(1), First View Level(1)});
gbb << Remove Variable(3);

 

-Jarmo
hogi
Level XII

Re: jsl code to change the "view" for a graph builder plot with X grouping?

very creative workaround