Home Page

Tips page
c
cellulari
debian
egittologia
emacs
emacs-latex
hardware
html
inglese
java
latex
linux
matlab
misc
mysql
network
octave

*Save a plot to a file

programming
python
security
sed
tech
webapps
windows

University Page

Programming

Debian & Linux

Some works

About me

Del.icio.us Bookmarks

BOINC Combined Statistics

Site Statistics

Contact me sending an e-mail (antispam defense activated)

debian

hacker emblem

blogger

GeoURL

View Sandro Tosi's profile on LinkedIn

This is my Google PageRank

Title: Save a plot to a file
Author: Sandro Tosi
Last modified: 2005-04-26

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 octave-forge  (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/octave-lists/archive/help-octave.2004/msg01374.html
http://math.cochise.edu/Doc/octave/basic_octave.html