[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Creating figures with Octave Plot
From: |
Miguel Bazdresch |
Subject: |
Re: Creating figures with Octave Plot |
Date: |
Thu, 23 Sep 2010 12:54:12 -0500 |
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