

Home Page
Tips page
University Page
Programming
Debian & Linux
Some works
About me
Del.icio.us Bookmarks
BOINC Combined Statistics
Site Statistics
Contact me sending an email (antispam defense activated)




Title: Save a plot to a file
Author: Sandro Tosi
Last modified: 20050426
You've just finished drawing a beautiful graph and you want to include
it into your paper or web page, but how?
Octave, as far as I know, use Gnuplot to draw its graphics; now, if
you want to plot to a file you have to educate Gnuplot to do so.
The commands is the following (suppose your graph is already on the
screen, i.e. you've already used `plot' function):
octave:1> gset term png;
to set the output to a png file
octave:2> gset output "<filename>";
to set the output file
octave:3> replot
to finally write the already drawn graph to <filename>. Now, every
graph you're going to plot, will be redirected to <filename>; if you
want back the plot window, type:
octave:4> gset term x11;
and the nice window will again pop up.
Note: I recommend you to download octaveforge (Debian package name)
from http://octave.sourceforge.net/ which includes a big number of
interesting and useful tool, some enhancing octave plot ability.
Some more infos can be retrieved on these websites:
http://www.octave.org/octavelists/archive/helpoctave.2004/msg01374.html
http://math.cochise.edu/Doc/octave/basic_octave.html
