cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
SampleTapir814
Level II

Saving multiple graphs in a window report to a single svg

I am trying to save all the graphs in a bivariate report to an svg.  When I use "Save as" to do it it works fine.  I can't get it to work in jsl.  

 

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
jthi
Super User

Re: Saving multiple graphs in a window report to a single svg

According to Scripting Index << Save Window Report is used to save the report as JMP report file

jthi_0-1697569903996.png

I think you have to use Save Picture if you wish to have SVG and if you are using By variables, you might have to wrap your report to new window (or get a reference to the report)

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("",
	dist = dt << distribution(Column(:height), By(:age));
);

nw << Save Picture("$DOWNLOADS/test.svg", "svg");

And why use save picture is based on this Export option and a guess

jthi_1-1697570362694.png

 

-Jarmo

View solution in original post

SampleTapir814
Level II

Re: Saving multiple graphs in a window report to a single svg

Bingo!  Adding New Window worked.  Thanks Jarmo!

BLAH_REPORT = New Window("", Bivariate( Y( :Data ), X( :pdatetime ), By( :SEQ, :CATEGORY, :STAGE, :STEP, :MEAS_TYPE ), Add Text Annotation( Text( "Updated: " || date_today ), Fixed Size( 2 ), Text Box( {1400, 3, 1800, 62} ), Filled( 0 ) ), SendToReport( Dispatch( {}, "Bivar Plot", FrameBox, {Row Legend( :GRP, Color( 1 ), Color Theme( "STRONG" ), Marker( 0 ), Marker Theme( "" ), Continuous Scale( 0 ), Reverse Scale( 1 ), Excluded Rows( 0 ) ), Frame Size( 1367, 480 )} ) ) ); );

View solution in original post

4 REPLIES 4
jthi
Super User

Re: Saving multiple graphs in a window report to a single svg

According to Scripting Index << Save Window Report is used to save the report as JMP report file

jthi_0-1697569903996.png

I think you have to use Save Picture if you wish to have SVG and if you are using By variables, you might have to wrap your report to new window (or get a reference to the report)

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("",
	dist = dt << distribution(Column(:height), By(:age));
);

nw << Save Picture("$DOWNLOADS/test.svg", "svg");

And why use save picture is based on this Export option and a guess

jthi_1-1697570362694.png

 

-Jarmo
SampleTapir814
Level II

Re: Saving multiple graphs in a window report to a single svg

Thanks jthi.  I appreciate the suggestion. 

 

When I use Save picture is saves only one chart from the window report not the whole collection.  Using "Save As" and graph type svg saves them all.  Not sure how to mimic what save as is doing in jsl.

jthi
Super User

Re: Saving multiple graphs in a window report to a single svg

Print what your BLAH_REPORT variable contains. Most likely it is a list and you are sending the save message to all of those different plots in that (they will most likely overwrite each other or only first one is being saved). You will have to get the reference to the whole report, you have few options: use new window and create bivariate inside it (see my earlier message) or you could use << top parent on first of the plot to get the highest level reference (replace dist with your variable)

(dist[1] << top parent) << Save Picture("$DOWNLOADS/test.svg", "svg");
-Jarmo
SampleTapir814
Level II

Re: Saving multiple graphs in a window report to a single svg

Bingo!  Adding New Window worked.  Thanks Jarmo!

BLAH_REPORT = New Window("", Bivariate( Y( :Data ), X( :pdatetime ), By( :SEQ, :CATEGORY, :STAGE, :STEP, :MEAS_TYPE ), Add Text Annotation( Text( "Updated: " || date_today ), Fixed Size( 2 ), Text Box( {1400, 3, 1800, 62} ), Filled( 0 ) ), SendToReport( Dispatch( {}, "Bivar Plot", FrameBox, {Row Legend( :GRP, Color( 1 ), Color Theme( "STRONG" ), Marker( 0 ), Marker Theme( "" ), Continuous Scale( 0 ), Reverse Scale( 1 ), Excluded Rows( 0 ) ), Frame Size( 1367, 480 )} ) ) ); );