Friday, November 25, 2005

 

Plotting in Matlab without X-window

Matlab can be operated in non-GUI mode. To start matlab:
matlab -nodesktop -nojvm -nosplash
If you wish to plot graphs without using X or GUI, open a figure with visibility hidden, plot the graph and then print the figure to a file.
>> h = figure('Visible', 'off')
h =

     1
figure returns a handle to figure. Now issue the plot command.
plot(1:4,5:8)
The figure can now be saved using the print command.
print -f1 -dps 'filename.ps'
The syntax for the print command is
print -fhandle -ddevice.
In our case, the handle is 1 and device is post script file.

Update: As posted by anonymous, another option is to use
saveas(h,'file.png');

Comments:
Another option is,

figure(..);
plot(..);
saveas(1,'file.png');

 
Correction...

h=figure(..);
plot(..);
saveas(h,'file.png');

 
Oes Tsetnoc one of the ways in which we can learn seo besides Mengembalikan Jati Diri Bangsa. By participating in the Oes Tsetnoc or Mengembalikan Jati Diri Bangsa we can improve our seo skills. To find more information about Oest Tsetnoc please visit my Oes Tsetnoc pages. And to find more information about Mengembalikan Jati Diri Bangsa please visit my Mengembalikan Jati Diri Bangsa pages. Thank you So much.
Oes Tsetnoc | Semangat Mengembalikan Jati Diri Bangsa
 
Post a Comment

Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?