Hi,
I want to JSL to generate report (.ppt).
There are 2 plots I want to export: 5 groups and 3 groups.
I want each group with 250*250, so 5 groups plot should be 1250*250 and 3 groups plot should be 750*250.
I use Save Presentation to export plots.
5 groups size is the same as I export plots manually but 3 groups size is not. The 3 groups size is squeezed, only 75%.
How could I export multiple plots with the same scale and resolution?
NonLeakage_graph = dt << Graph Builder(
Size( 1250, 250 ),
Variables( X( :Lot ), Y( :drift% ), Group X( :Label ), Color( :Lot ) ),
Elements( Box Plot( X, Y, Legend( 1 ) ) ),
By( :Rel_Test ),
SendToReport(
Dispatch( {}, "drift%", ScaleBox,
{Format( "Percent", 12, 0 ), Min( -0.25 ), Max( 0.25 ), Inc( 0.05 ),
Minor Ticks( 0 ), Add Ref Line( 0.2, "Solid", "Red", "20%", 1 ),
Add Ref Line( -0.2, "Solid", "Red", "-20%", 1 )}
)
)
);
NonLeakage = NonLeakage_graph << Report;
save_path = "D:\Reliability Qual\reliability report template\jmp_example.pptx";
For( i = 1, i <= N Items( NonLeakage ), i++,
If( File Exists( save_path ),
NonLeakage[i] << Save Presentation( save_path, Append );
,
NonLeakage[i] << Save Presentation( save_path );
)
);
NonLeakage << Close Window;
dt << Clear Row States;
dt << Select Where( (Contains( {"0cyc", "0hrs"}, :ReadPoint )) | (!Contains( {"IGSS", "IGSSR", "IDSS"}, :Label )) );
dt << Hide( 1 ) << Exclude( 1 );
dt << Clear Selection;
dt << Select Where( (!Contains( {"0cyc", "0hrs"}, :ReadPoint )) & (Contains( {"IGSS", "IGSSR", "IDSS"}, :Label )) );
Summarize( dt, l_groups = By( :Rel_Test ) );
Leakage_graph=dt << Graph Builder(
SendToByGroup( {:Rel_Test == "H3TRB"} ),
Size( 750, 250 ),
Variables( X( :Lot ), Y( :drift% ), Group X( :Label ), Color( :Lot ) ),
Elements( Box Plot( X, Y, Legend( 1 ) ) ),
By( :Rel_Test ),
SendToReport(
Dispatch( {}, "drift%", ScaleBox,
{Format( "Fixed Dec", 12, 0 ), Min( 0 ), Max( 20 ), Inc( 5 ),
Minor Ticks( 0 ), Add Ref Line( 10, "Solid", "Red", "10", 1 )}
)
)
);
Leakage = Leakage_graph << Report;
Leakage << Save Presentation( "D:\Reliability Qual\reliability report template\jmp_example.pptx",append );
Hi hogi,
This does not work. Everything looks good in JMP but after exporting to PPT, the plots' scales are different.
Hi @LT ,
You seem to be right. However, the issue is not where I thought it was.
With the hints in the first link, you can achieve a lot — even more than I thought possible when I wrote my first reply.
This code creates plots with the requested proportions:
Three frames with 250x250 -> 750x250
and five frames with 250x250 -> 1250x250.
When you copy the graphs to the clipboard and paste them into a graphics program, you can see that all the subplots are the same size.
The code also points to the actual problem:
regardless of the size of the PNG or JPG image, it can be scaled in the presentation according to some hidden rules.
I fear that the << save presentation function doesn't allow the user to adjust these rules.
A workaround: You can use scripting (e.g. via the Python interface in JMP) to specify the size and position of the inserted graphs in the presentation.
Alternatively, you can email support@jmp.com for further suggestions.
Perhaps there is a hidden setting in << save presentation ...
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class Families.jmp" );
fn = "$TEMP/jmp_example.pptx"
biv = bivariate( y( :weight ), x( :height ) );
rbiv = biv << report;
rbiv << Save Presentation(fn );
For each( {selection}, {{13, 14, 15}, {13, 14, 15, 16, 17}},
Eval(
Eval Expr(
gb = Graph Builder(
Fit to Window( "Off" ),
Variables(
X( :height ),
Y( :weight ),
Group X( :age ),
Overlay( :age )
),
Elements(
Points( X, Y ),
Smoother( X, Y )
),
Local Data Filter(
Conditional,
Add Filter(
columns( :age ),
Where( :age == Expr( selection ) )
)
)
)
)
);
fb = Report( gb )[FrameBox( 1 )];
fb << Frame size( 250, 250 );
// show(fb << get size);
gb << save presentation( fn, Append );
);
Web( fn );