Use the following sequence of commands to connect and start MATLAB:
ssh -x user@server # disabled X11 forwarding
unset DISPLAY # unset DISPLAY variable
matlab -nodisplay # start MATLAB without the desktop
then a simple plot to illustrate:
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
I just tried it myself, and it works as expected.
EDIT:
You can always specify the DPI resolution using -r<number>
, for example a very high resolution:
print -dpdf -r600 file.pdf
Note that you can use -r0
to specify screen resolution.
Also you can turn on WYSIWYG printing of figures using the PaperPositionMode
property:
figure, close
plot(1:10)
set(gcf, 'PaperPositionMode', 'auto')
print -deps2c -r0 file.eps
exit
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…