[Top][All Lists]

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

LaTeX in octave/automated plots

From: John W. Eaton
Subject: LaTeX in octave/automated plots
Date: Sun, 25 Nov 2007 15:27:53 -0500

On 25-Nov-2007, A. Scottedward Hodel wrote:

|  From time to time I've seen discussion on how to integrate LaTeX  
| code into Octave plots and, in turn, to integrate those plots into a  
| LaTeX document.  I'm in the process of writing a textbook with more  
| than 250 plots/m-files, entirely done in Octave, and so the ability  
| to automate this process is an important feature.
| I've tried several approaches which I summarize here.

| (1) eps only  Print as an eps file directly:
|       print -deps -mono myfile.eps

| (2) epslatex/dvips Use epslatex, then use dvips -E* in a shell script  
| to generate a cropped .eps file that can be resized.

| (3) eps/psfrag Print as an eps file and use psfrag in LaTeX to  
| process embedded LaTeX commands (requires an additional shell script)

| (4) xfig/fig2ps Print as a fig file, then use fig2ps to generate an  
| eps file

For something like this, I recommend using Octave to generate the data
and then using gnuplot (or your favorite graphics package) to generate
the plots from the data.  A big advantage of separating the
calculation and plot generation is that you don't need to run a long
calculation again just to make a change in the appearance of a figure.
If using gnuplot, I recommend using the epslatex terminal and epstopdf
(or the equivalent ghostscript command) to generate pdf files from the
eps files.


reply via email to

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