cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
lazzybug
Level III

How to use JMP Script to modify the frame size for existing report?

Hi @txnelson, thank you so much to answer my previous question. Since I have more than 30 DoE models, that's why I am trying to automate my data analysis and copy & paste graphs. Could you please tell how to adjust the Frame Size for example "Residual Normal Quantile Plot" by modifying the code below like " {"Response XXXX", "Residual Normal Quantile Plot"},
"Bivar Resid Quantile Plot",
FrameBox,
{Frame Size( 271, 213 )}"?

 

I can manually adjust the frame size by editing model fit, but it's very time consuming

 

Here is a piece of code that will open the Summary of Fit if it isn't open.

ob = rbiv << XPath( "//OutlineBox[ contains( text(), 'Response' ) ]" );

Print( ob );

For( i = 1, i <= N Items( ob ), i++,
	name = ob[i] << get title;
	Print( name );
	obj = ob[i] << get scriptable object;
	try( obj<<Summary of Fit(1));
	ob[i] << Close( 1 );
	ob[i]["Summary of Fit"] << Close( 0 );
	ob[i]["Parameter Estimates"] << Close( 0 );
);

Additionally, it is a simple matter to open the Summary of Fit sections for all models, with one click.  If you hold down the CNTL key and click on the Summary of Fit selection, and all models will have the Summary of Fit added to the analysis.

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: How to use JMP Script to modify the frame size for existing report?

OK, it is time for you to do some reading.  You need to take the time to read about Display Trees in the Scripting Guide.  This will provide you with the details on how to manipulate the JMP output.  You need to also take the time to learn about the XPATH() function, and the XPATH elements.  It is a standardized method for searching XML.

Here is the modification you requested

names default to here(1);
rbiv = current report();

ob = rbiv << XPath( "//OutlineBox[ contains( text(), 'Response' ) ]" );

Print( ob );

For( i = 1, i <= N Items( ob ), i++,
	name = ob[i] << get title;
	Print( name );
	obj = ob[i] << get scriptable object;
	try( obj<<Summary of Fit(1));
	ob[i] << Close( 1 );
	ob[i]["Summary of Fit"] << Close( 0 );
	ob[i]["Parameter Estimates"] << Close( 0 );
	ob[i][Frame Box(1)] << Frame Size(400,400);
	ob[i][Frame Box(2)] << Frame Size(400,400);
);
Jim

View solution in original post

vince_faller
Super User (Alumni)

Re: How to use JMP Script to modify the frame size for existing report?

3 REPLIES 3
txnelson
Super User

Re: How to use JMP Script to modify the frame size for existing report?

OK, it is time for you to do some reading.  You need to take the time to read about Display Trees in the Scripting Guide.  This will provide you with the details on how to manipulate the JMP output.  You need to also take the time to learn about the XPATH() function, and the XPATH elements.  It is a standardized method for searching XML.

Here is the modification you requested

names default to here(1);
rbiv = current report();

ob = rbiv << XPath( "//OutlineBox[ contains( text(), 'Response' ) ]" );

Print( ob );

For( i = 1, i <= N Items( ob ), i++,
	name = ob[i] << get title;
	Print( name );
	obj = ob[i] << get scriptable object;
	try( obj<<Summary of Fit(1));
	ob[i] << Close( 1 );
	ob[i]["Summary of Fit"] << Close( 0 );
	ob[i]["Parameter Estimates"] << Close( 0 );
	ob[i][Frame Box(1)] << Frame Size(400,400);
	ob[i][Frame Box(2)] << Frame Size(400,400);
);
Jim
lazzybug
Level III

Re: How to use JMP Script to modify the frame size for existing report?

@txnelson, I will spend more time reading the manual definitely, thank you so much for your recommendation. The coding in JMP is quite different with other programming language, the learning curve is a little bit longer to get familiar with. But it's very powerful to automate my work, thank you again.

vince_faller
Super User (Alumni)

Re: How to use JMP Script to modify the frame size for existing report?

I find this to be a good resource from Farhan about XPath. 

 

https://community.jmp.com/t5/Discovery-Summit-2015/JMP-Discovery-2015-Mining-JMP-Reports-v10-pdf/ta-...

Vince Faller - Predictum