cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
Dennisbur
Level IV

Variability graph for JSL

Hello,

I have written a script JSL for the Variability graph

obj = dt << Variability Chart(
	Y( :NUMERIC_RESULT ),
	X( :TEST_NAME 3 ),
	BY( :TYPE )
);
(obj << Report)[FrameBox( 1 )] << Frame Size( 700, 600 );
(obj << Report)[AxisBox( 1 )] <<
Add Ref Line( 340, "Solid", "Red", "Limit 340", 1 );
(obj << Report)[AxisBox( 1 )] <<
Add Ref Line( 280, "Solid", "Red", "Limit 280", 1 );

and would like to determine the size of the graph and limits line.

I tried to use AxisBox

for size:

(obj << Report)[FrameBox( 1 )] << Frame Size( 400, 400 );

for limits:

(obj << Report)[AxisBox( 1 )] << Add Ref Line( 340, "Solid", "Red", "Limit 340", 1 );
(obj << Report)[AxisBox( 1 )] << Add Ref Line( 280, "Solid", "Red", "Limit 280", 1 );

but I received error.

Can you please fix my script for this requests

Dennisbur_0-1683210467771.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Variability graph for JSL

The obj variable contains a list of Variability Chart objects for each level of the By variable. You are subscripting a list with a display box, which is invalid. Try this alternative in which you subscript the list with an index first:

 

// obj is a list of analysis layer references
obj = dt << Variability Chart( Y( :NUMERIC_RESULT ), X( :TEST_NAME 3 ), BY( :TYPE ) );

// rpt is a list of report layer references
rpt = obj << Report;

// identify By group levels
Summarize( type = Group( :TYPE ) );

// iterate over By group levels to modify display boxes
For( t = 1, t <= N Items( type ), t++,
	rpt[t][FrameBox( 1 )] << Frame Size( 700, 600 );
	rpt[t][AxisBox( 1 )] << Add Ref Line( 340, "Solid", "Red", "Limit 340", 1 );
	rpt[t][AxisBox( 1 )] << Add Ref Line( 280, "Solid", "Red", "Limit 280", 1 );
);

 

View solution in original post

3 REPLIES 3

Re: Variability graph for JSL

The obj variable contains a list of Variability Chart objects for each level of the By variable. You are subscripting a list with a display box, which is invalid. Try this alternative in which you subscript the list with an index first:

 

// obj is a list of analysis layer references
obj = dt << Variability Chart( Y( :NUMERIC_RESULT ), X( :TEST_NAME 3 ), BY( :TYPE ) );

// rpt is a list of report layer references
rpt = obj << Report;

// identify By group levels
Summarize( type = Group( :TYPE ) );

// iterate over By group levels to modify display boxes
For( t = 1, t <= N Items( type ), t++,
	rpt[t][FrameBox( 1 )] << Frame Size( 700, 600 );
	rpt[t][AxisBox( 1 )] << Add Ref Line( 340, "Solid", "Red", "Limit 340", 1 );
	rpt[t][AxisBox( 1 )] << Add Ref Line( 280, "Solid", "Red", "Limit 280", 1 );
);

 

Dennisbur
Level IV

Re: Variability graph for JSL

So if I understood well, due to   BY( :TYPE ) I need to use index FOR?
For example, if I have used it without function BY, can I use it directly without FOR?

obj = dt << Variability Chart(
                                        Y( :NUMERIC_RESULT ),
                                        X( :TEST_NAME 3 )
                                          );

(obj << Report) [FrameBox (1)] << Frame Size (700, 600);

(obj << Report) [AxisBox (1)] << Add Ref Line( 340, "Solid", "Red", "Limit 340", 1);

(obj << Report) [AxisBox (1)] << Add Ref Line( 280, "Solid", "Red", "Limit 280", 1);

Re: Variability graph for JSL

Yes, that way, without a variable in the By role, should work because the variable obj is no longer a list but a single analysis layer reference.