嗨,JMPer
我使用的是 Mac 版本,想透過 jsl 將一些箱線圖儲存為 PNG。
如何提高PNG圖片解析度?
我使用了下面的jsl並更改了解析度號,它仍然不起作用。
graph1 <<SAVE picture=""></SAVE>
The resolution is not good as below.
<SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CompleteLeopard_0-1718694893216.png" style="width: 400px;"><span class="lia-inline-image-display-wrapper" image-alt="CompleteLeopard_0-1718694893216.png" style="width: 400px;"><img src="https://us.v-cdn.net/6038925/uploads/images/65312iA315AACEFE15A632/CompleteLeopard_0-1718694893216.png" role="button" title="CompleteLeopard_0-1718694893216.png" alt="CompleteLeopard_0-1718694893216.png" /></span></SPAN>
Craige 對 SVG 的建議很好。如果這是 Mac 特定的,我還建議嘗試 PDF,這是標準的 Mac 向量格式。
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" );
這會產生隨附的 Test.pdf 檔案。
如果該格式適用於圖形的目標,請嘗試另存為 SVG(可縮放向量圖形)。 SVG 並不是 100% 跨瀏覽器的標準,但可能是您想要的。
或者,嘗試這樣的事情:
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.背景確實很大,插圖縮小了。
不確定如何處理輕量級框架,您也許可以使用參考線來修復它。
對於 Windows,您可以變更「儲存映像 DPI」首選項值
Names Default To Here(1);
//Caution: Changing a preference will
//affect the default behavior of JMP.
Preferences[1] << Set(Save Image DPI(300));
但這似乎是 Windows 特定命令。不確定 mac 上唯一的選擇是否是在儲存之前增加影像大小(這可能有幫助)。
PNG 和 JPEG 影像的解析度 (DPI)(Windows 特定首選項)
使用 JMP > 儲存與分享資料 > 儲存報表 > 設定匯出圖形的圖形 DPI