help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving Octave Plots


From: Steve C. Thompson
Subject: Re: Saving Octave Plots
Date: Tue, 15 Mar 2005 11:58:52 -0800
User-agent: Mutt/1.3.28i

> Is it possible to save octave plots other than capturing them on the
> screen?

Octave uses Gnuplot for its plotting.  By default, the plots are printed
to the screen.  This can be changed by using gset and the various
options in Gnuplot.  Octave documents gset here:

  http://www.octave.org/doc/octave_18.html#SEC134

and the manual for Gnuplot is here:

  http://www.gnuplot.info/docs/gnuplot.html

I use LaTeX for documentation.  I've found that a nice way to include
figures is to take the following steps:

  (1) Use Octave to generate data.  Save data as an ASCII text file.
      The x-axis is the first column.  The first line to plot is the
      second column; the second line to plot is the third column; etc.

  (2) Use Gnuplot to plot the data and output the figure in LaTeX code.
      Like with Octave, you can write a script to interact with Gnuplot.
      The first line of the script sets the output to pslates:

        set term pslatex monochrome dashed rotate 8

      The output is defined as

        set output "plot.tex"

      The plotting command might be

        plot [0:30][0:2.5] "~/work/2005/datafile"\
          every 2 title 'Line 1' with lines ls 1

      where the linestyle (ls) defined as
      
        set style line 1 lt 2 lw 1

      etc.

  (3) The LaTeX code in included into the LaTeX source file:

        \input{plot.tex}

This is just one specific way Octave with Gnuplot can be used.  It might
give you some ideas.


Steve


On Mar 15 12:41PM, Carlos Sevcik wrote:
> Is it possible to save octave plots other than capturing them on the
> screen?
> 
> Thanks
> 
> -- 
> Carlos Sevcik, MD PhD
> Professor
> Head, Laboratory on Cellular Neuropharmacology



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]