help-octave
[Top][All Lists]
Advanced

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

Re: Creating figures with Octave Plot


From: bpabbott
Subject: Re: Creating figures with Octave Plot
Date: Thu, 23 Sep 2010 19:06:03 +0000 (GMT)

On Sep 23, 2010, at 01:54 PM, Miguel Bazdresch <address@hidden> wrote:

On Thu, Sep 23, 2010 at 10:02 AM, Ian Journeaux <address@hidden> wrote:
>
> I am trying to create plots in Octave that I can use in a LaTeX report I am
> creating.

I have resorted to the following method to produce beautiful plots in
latex. First, install the pgfplots latex package
(http://pgfplots.sourceforge.net/). Then, from octave, save your data
to a file:

save -ascii [x' y'] data.dat

Then, use tikz to import the data (from within your latex document);
for example:

\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
width=8.5cm,
xlabel={some text},
ylabel={some other text}
]
\addplot[color=blue] file {data.dat}
\end{axis}
\end{tikzpicture}
\caption{Some text.}
\label{alabel}
\end{figure}

This is more work than just importing a graphics file, but the results
are beautiful and (IMO) well worth the time. See http://texample.net
for many more examples and resources.

HTH,

--
Miguel Bazdresch
 
TikZ does produce very nice plots. The newer gnuplot-4.4 includes support, which the next release of Octave will support.

For those will older installations, the solution above will work nicely.

Ben




reply via email to

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