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

How to set graph size when export to PPT by JSL (graph builder)

Hello, I am a beginer of jsl . I have one question about setting picture size when saving to PPT. 

 

Below script does work when I was trying to save a bivariate graph. 

 

Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
biv = bivariate( y( :weight ), x( :height ), Group By(:sex), Fit Line({report(0)}) );
rbiv = biv << report;
rbiv[Framebox(1)] << row legend(:sex, color(1), marker(1));
rbiv << Save Presentation( "$TEMP/jmp_example.pptx");
rbiv[Framebox(1)] << frame size(1500,480);
rbiv << Save Presentation( "$TEMP/jmp_example.pptx", append );
Open( "$TEMP/jmp_example.pptx" );

 

 

 However, When I was trying to save a graph from graph builder, below script seems doesn't work.

Thus, my question is how to set graph size when export to PPT by JSL especially in graph from graph builder.

Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
biv =Graph Builder(
	Size( 755, 297 ),
	Show Control Panel( 0 ),
	Variables( X( :age ), Y( :height ) ),
	Elements( Bar( X, Y, Legend( 4 ) ) )
);
rbiv = biv << report;
rbiv[Framebox(1)] << row legend(:sex, color(1), marker(1));
rbiv << Save Presentation( "$TEMP/jmp_example.pptx");
rbiv[Framebox(1)] << frame size(1400, 600);
rbiv << Save Presentation( "$TEMP/jmp_example.pptx", append );
Open( "$TEMP/jmp_example.pptx" );


 

2 REPLIES 2
ih
Super User (Alumni) ih
Super User (Alumni)

Re: How to set graph size when export to PPT by JSL (graph builder)

Hi @LIANGYAHAN, thank you for the easily reproducible example.

 

It looks like you hit on one of the harder-to-dubug parts of JMP which is when a message is sent to an object that isn't created yet. A wait(0) statement will often fix cases where something works as expected interactively when you execute one line at a time (as this one does) but does not work when run all together.  In this case, adding a Wait(0); before the frame size message should solve your problem.

 

The wait function will allow JMP to draw all elements and 'catch up' to where you would be if running one line at a time interactively.

 

Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
biv =Graph Builder(
	Size( 755, 297 ),
	Show Control Panel( 0 ),
	Variables( X( :age ), Y( :height ) ),
	Elements( Bar( X, Y, Legend( 4 ) ) )
);
rbiv = biv << report;
rbiv[Framebox(1)] << row legend(:sex, color(1), marker(1));
rbiv << Save Presentation( "$TEMP/jmp_example2.pptx");
wait(0);
rbiv[Framebox(1)] << frame size(1400, 600);
rbiv << Save Presentation( "$TEMP/jmp_example2.pptx", append );
Open( "$TEMP/jmp_example2.pptx" );
LIANGYAHAN
Level I

Re: How to set graph size when export to PPT by JSL (graph builder)

Hi @ih 

 

Thank you for your prompt response.

I tried the script you suggested but it wasn't successful. The result is shown in the attachment "jmp_example2 (graph builder)".

 

I expect that the second graph should be larger than the first graph cuz the frame size was set to (1400, 600) in the second graph but they didn't work as my expectation.

 

However, when I tried to export a bivariate graph, it was successful. The result is shown in the attachment "jmp_example (Bivariate)".

 

I doubt that the script is not suitable for graph builder.

Could you help me to figure out this question?

Thank you so much!