Tuesday, July 24, 2012

Use Matlab plotting in commandline mode

 
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 -dpdf -r600 file.pdf       # save the figure as file.ps
saveas(gcf, 'file.eps', 'eps2c') # saveas aslo works
exit                             # done
 
original discussion 

No comments:

Post a Comment