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
ivan_i
Level I

adding graphics to each framebox

Hey guys, 

i'm new to JSL and would so appreciate your help with a script i'm struggling with for a while.

 

i wrote a script that produces multiple graphs in one scroll box.

The problem is that i have a different number of frameboxes for each graph and i can't get track of the exact number. it also changes when i change the filter bar param. therefore when i'm trying to add graphics like circle to a framebox that do not exist i receive the message "cannot find framebox..." on the embedded log.

i found a script online that looks like it solves my problem but my script goes into an infinite loop and the error message keeps showing.

 

the script i was trying:

haveFrameBox =1;
i=0;
while(haveFrameBox,
	try(
		i++; 
		report(gb)<<dispatch({}, "Graph builder",FrameBox(i),circle({0,0},150)) ;
		,
		haveFrameBox=0
		)		
);

 I'm also having troubles with applying "size to isometric" function on each framebox with a for loop, for each i

try(Report(gb)[FrameBox(i)] << size to isometric)

but the output is just a big mess...

 

Any idea?

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: adding graphics to each framebox

You need to take a look at the XPath() function.  It may do what you are looking for.  Here is a simple use of it to find the number of Frame Boxes in a display

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
biv = bivariate( x( :weight, :age ), y( :height ), by( :sex ) );
Show( N Items( (biv << xpath( "//FrameBox" )) ) );

Take a look in the Scripting Index

Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: adding graphics to each framebox

You need to take a look at the XPath() function.  It may do what you are looking for.  Here is a simple use of it to find the number of Frame Boxes in a display

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
biv = bivariate( x( :weight, :age ), y( :height ), by( :sex ) );
Show( N Items( (biv << xpath( "//FrameBox" )) ) );

Take a look in the Scripting Index

Jim
ivan_i
Level I

Re: adding graphics to each framebox

Thank you! it worked like magic
Byron_JMP
Staff

Re: adding graphics to each framebox

an additional thank you

JMP Systems Engineer, Health and Life Sciences (Pharma)