Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
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
Highlighted
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

2 REPLIES 2
Highlighted
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

Highlighted
ivan_i
Level I

Re: adding graphics to each framebox

Thank you! it worked like magic
Article Labels

    There are no labels assigned to this post.