Exporting multiple Graphs with different scriptsHey Jmp users,
I am trying to export multiple graphs in Jmp. Is there anyway to select the corresponding scripts and export all the graphs together.
Thanks a lot !
I
Data TableGraphicsScriptingRe: Exporting multiple Graphs with different scriptsHere's an example that exports three graphical outputs from Big Class to a word doc.
dt = open("$sample_data\Big Class.jmp");
dist = expr(dt << Distribution(
Continuous Distribution( Column( :weight ) ),
Nominal Distribution( Column( :age ) )
));
gb1 = expr(dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :age ), Y( :sex ) ),
Elements( Heatmap( X, Y, Legend( 2 ) ) )
));
gb2 = expr(dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
));
nw = new window("Example Export Multiple Platforms",
chart_output = vlistbox(
dist,
page break box(),
gb1,
page break box(),
gb2
);
);
chart_output << save msword("c:\temp\SampleCharts.doc", Native);Re: Exporting multiple Graphs with different scriptsHi @JMPdiscoverer ,
I was coming up with a similar solution to @pmroz , and I like what they did.
Here's what I was thinking, but not as nice as making a word document, etc. You can also save them directly to PPT files as well. I created the reports in the JSL just to have them handy, but the for loops can work if you've already got them open. But, if you write a script that generates the reports, you can just reference the report by variable name instead of finding a list of windows.
Names Default To Here( 1 );
dt = open("$sample_data\Big Class.jmp");
rpt1 = dt << Bivariate( Y( :weight ), X( :height ) );
rpt2 = dt << Oneway( Y( :height ), X( :age ), X Axis Proportional( 0 ) );
rpt3 = dt << Fit Group(
Oneway( Y( :weight ), X( :age ), X Axis Proportional( 0 ) ),
Bivariate( Y( :weight ), X( :height ) ),
<<{Arrange in Rows( 2 )}
);
reportlist = {};
For( i = 0, i <= N Items( Window() ), i++,
If(
!Is Missing( Regex( Window( i ) << getwindow title, "Fit" ) ) == 1 | !Is Missing(
Regex( Window( i ) << getwindow title, "Oneway" )
) == 1 | !Is Missing( Regex( Window( i ) << getwindow title, "Bivariate" ) ) == 1,
Insert Into( reportlist, Window( i ) << get window title )
)
);
For( i = 1, i <= N Items( reportlist ), i++,
picbox = Window( reportlist[i] ) << getPicture;
picbox << SaveImage(
"whatever your local directory to save is\pic" || Char( i ) || ".png"
);
); These should get you working well on your way.
Good luck!,
DS