保存Matlabに見えないプロットの下にカップル、ファミリー、グループの画像と同じサイズ

StackOverflow https://stackoverflow.com/questions/1853259

質問

私はSSH接続のLinuxサーバーと、いくつかのMATLABプログラミングうに保存見えないとしてプロット

figH = figure('visible','off') ;  
% Plot something  
% save the plot as an image with same size as the plot   
close(figH) ;   

saveas()print() 変更のサイズを保存した画像以外のサイズ。も print(), 全レンダリングモード-opengl, -ZBuffer-painters)では使用できません端末エミュレーションモードのLinuxサーバーです。 getframe() 動作しない。どのように思われるでしょうかいな問題を解決できる?是非宜しくお願いします!

役に立ちましたか?

解決

以下の配列のコマンドで、接続開始MATLAB:

ssh -x user@server          # disabled X11 forwarding
unset DISPLAY               # unset DISPLAY variable
matlab -nodisplay           # start MATLAB without the desktop

その後簡単なプロットの例:

figure, close                    # must do this first, otherwise plot is empty
plot(1:10)                       # usual plotting
print file                       # save the figure as file.ps
saveas(gcf, 'file.eps', 'eps2c') # saveas aslo works
exit                             # done

ったので自分自身で作品として期待される。


編集:

できることがで指定しDPIの解像を組み合わせた低解像度 -r<number>, 例えば、非常に高い分解能:

print -dpdf -r600 file.pdf

注意利用できる -r0 指定画面解像度

もることができ WYSIWYGの印刷図 を使用 PaperPositionMode 物件:

figure, close
plot(1:10)
set(gcf, 'PaperPositionMode', 'auto')
print -deps2c -r0 file.eps
exit
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top