BookmarkSubscribe
Choose Language Hide Translation Bar
Jim_G_Pappas
Community Trekker

script to automatically change Y-variable on graph to a different variable

Hello.  I would like to be able to send my graph (a simple scatterplot made in graph builder) a scripted message that would automatically change the current Y-variable to a different variable.   I don't really want to redo the graph because of several "bells and whistles" that are already part of the script.   I know that column switcher is a great way to present a dialog box of options to the user, but really just want it done automatically in  a single step.   Any advice is appreciated... Thanks, Jim

Jim Pappas
0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: script to automatically change Y-variable on graph to a different variable

Here is an example of how to do this with a Graph Builder Scatterplot:

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
gb = Graph Builder(
	Size( 587, 495 ),
	Variables( X( :age ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 6 ) ) )
);

Wait( 4 );

ColumnSwitcherObject = gb << Column Switcher( :height, {:weight} );
ColumnSwitcherObject << Next;
ColumnSwitcherObject << run;
ColumnSwitcherObject << remove column switcher;
Jim

View solution in original post

2 REPLIES 2
Highlighted
txnelson
Super User

Re: script to automatically change Y-variable on graph to a different variable

Here is an example of how to do this with a Graph Builder Scatterplot:

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
gb = Graph Builder(
	Size( 587, 495 ),
	Variables( X( :age ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 6 ) ) )
);

Wait( 4 );

ColumnSwitcherObject = gb << Column Switcher( :height, {:weight} );
ColumnSwitcherObject << Next;
ColumnSwitcherObject << run;
ColumnSwitcherObject << remove column switcher;
Jim

View solution in original post

Jim_G_Pappas
Community Trekker

Re: script to automatically change Y-variable on graph to a different variable

Thank you so very much!  That worked and saved me a ton of time (assumming I could have ever figured that out).  Happy holidays....

Jim Pappas
0 Kudos