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

How to improve PNG picture resolution by jsl

Hi,JMPer

I'm using Mac version, and want to save some boxplot charts to PNG by jsl.

How to improve the PNG picture resolution?

 

I used below jsl and change resolution number, it sames not take effective.

graph1 <<Save Picture("/Users/Downloads/TEST"||"/TEST-"||text||".png","png",resolution(600));

 

The resolution is not good as below.

CompleteLeopard_0-1718694893216.png

 

 

3 REPLIES 3
jthi
Super User

Re: How to improve PNG picture resolution by jsl

For windows you could change the Save Image DPI preference value

 

Names Default To Here(1);
//Caution: Changing a preference will 
//affect the default behavior of JMP. 

Preferences[1] << Set(Save Image DPI(300));

but that seems to be Windows specific command. Not sure if the only option on mac would be to increase the image size before saving (it might help).

Resolution (DPI) for PNG and JPEG Images (windows specific preference) 

Using JMP > Save and Share Your Data > Save Reports > Set the Graphic DPI for Exported Graphics 

 

-Jarmo
hecht_jmp
Staff

Re: How to improve PNG picture resolution by jsl

Craige's suggestion of SVG is good. If this is Mac-specific, I would also recommend trying PDF, which is the standard Mac vector format.

 

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
r = dt << Oneway(
	Y( :height ),
	X( :age ),
	Quantiles( 1 ),
	Box Plots( 1 ),
	SendToReport( Dispatch( {}, "Quantiles", OutlineBox, {Close( 1 )} ) )
);

r << Save Picture( "$DESKTOP/Test.pdf", "PDF" );

This produces the attached Test.pdf file.

Craige_Hales
Super User

Re: How to improve PNG picture resolution by jsl

Try saving as SVG (scalable vector graphics) if that format will work with destination for the graphs. SVG is not 100% standard across browsers but may be what you want.

Or, try something like this:

dt = Open( "$sample_data/big class.jmp" );
bv = Bivariate(
	Y( :weight ),
	X( :height ),
	Fit Line( {Line Color( {61, 174, 70} ), Line Width( 10 )} ),
	SendToReport(
		Dispatch( {}, "height", ScaleBox, {Label Row( Set Font Size( 72 ) )} ),
		Dispatch( {}, "weight", ScaleBox, {Label Row( Set Font Size( 72 ) )} ),
		Dispatch( {}, "weight", TextEditBox, {Set Font Size( 72 )} ),
		Dispatch(
			{},
			"Bivar Plot",
			FrameBox,
			{Frame Size( 2000, 2000 ), Marker Size( 30 ), Marker Drawing Mode( "Normal" ), DispatchSeg(
				Line Seg( 1 ),
				{Line Color( {61, 174, 70} ), Line Width( 10 )}
			)}
		),
		Dispatch( {}, "height", TextEditBox, {Set Font Size( 72 )} ),
		Dispatch( {}, "Linear Fit", OutlineBox, {Close( 1 )} )
	)
);


Report( bv )[List Box( 1 )] << savepicture( "$desktop/biggraph.png" );

img = New Image( "$desktop/biggraph.png" );
img << scale( .25 );
New Window( "scaled to 1/4 size", img );

Really big in the background, scaled down inset.Really big in the background, scaled down inset.

 

Not sure what to do about the light-weight frame, you might be able to use the ref lines to fix it up.

 

 

Craige