cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

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

How to let user choose multiple columns for graph builder

Hi,

 

I'm just getting started in JSL coding, I am trying to create a script that can take user input (selection of y columns) and plot them in the graph builder. As of right now only the first Y column can be changed based on user's selection but the other 3 remains hard coded. How can I modify the code so that the graph builder will take multiple input selections and don't expect a fixed number of inputs? (Just like using the regular JMP GUI for Graph Builder where you can put multiple Y-values at ones).

 

Thanks!

 

ARETI052_0-1719430247122.png

ARETI052_1-1719430279674.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
hogi
Level XIII

Re: How to let user choose multiple columns for graph builder

or maybe

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = Graph Builder(
	Variables( X( :height ) ),
	Elements( Points( X ), Smoother( X ) )
);

for each ({col,idx}, {:height, :weight},
gb << Add Variable( {col , Role( "Y" ), Position(1)} ));

... if you want to add all Y values into one framebox

hogi_0-1719432187039.png

 

View solution in original post

2 REPLIES 2
hogi
Level XIII

Re: How to let user choose multiple columns for graph builder

use a for loop and 

hogi_0-1719431164737.png

 

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = Graph Builder(
	Variables( X( :height ) ),
	Elements( Points( X ), Smoother( X ) )
);

for each ({col}, {:age, :weight},
gb << Add Variable( {col , Role( "Y" )} ));

hogi_1-1719432226548.png

 

hogi
Level XIII

Re: How to let user choose multiple columns for graph builder

or maybe

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = Graph Builder(
	Variables( X( :height ) ),
	Elements( Points( X ), Smoother( X ) )
);

for each ({col,idx}, {:height, :weight},
gb << Add Variable( {col , Role( "Y" ), Position(1)} ));

... if you want to add all Y values into one framebox

hogi_0-1719432187039.png

 

Recommended Articles