cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Choose Language Hide Translation Bar
View Original Published Thread

Saving distribution plots

UserID16644
Level V

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" );

UserID16644_0-1687325408382.png

 

1 ACCEPTED SOLUTION

Accepted Solutions


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" );

 

View solution in original post

1 REPLY 1


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" );