- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Saving distribution plots
Hi all,
I have a distribution plot and I wanted to save the image as png. However, the only image that I am getting is the last image generated. How can I save all the plots?
dt_dist = Distribution(
Nominal Distribution( Column( :age ), Horizontal Layout( 1 ), Vertical( 0 ) ),
By( :sex )
);
dist = dt_dist << get picture;
dist << Save Picture( "C:\distribution_plot.png", "png" );
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Saving distribution plots
When you use the By() command, the platform returns a list, meaning that dist is actually a list with 2 values (dist[1] and dist[2] in this case). There may be more elegant ways to accomplish this, but one way would be to get a reference to the entire current window using Current Report ():
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt_dist = Distribution(
Nominal Distribution( Column( :age ), Horizontal Layout( 1 ), Vertical( 0 ) ),
By( :sex )
);
rpt = Current Report();
dist = rpt << get picture;
dist << Save Picture( "$DESKTOP\distribution_plot.png", "png" );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Saving distribution plots
When you use the By() command, the platform returns a list, meaning that dist is actually a list with 2 values (dist[1] and dist[2] in this case). There may be more elegant ways to accomplish this, but one way would be to get a reference to the entire current window using Current Report ():
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt_dist = Distribution(
Nominal Distribution( Column( :age ), Horizontal Layout( 1 ), Vertical( 0 ) ),
By( :sex )
);
rpt = Current Report();
dist = rpt << get picture;
dist << Save Picture( "$DESKTOP\distribution_plot.png", "png" );