summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pgfplots/pgfplots.importexport.tex
blob: e5a2a81b0476f45c9277832a1aab69c3a2e8f715 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
\section{Import/Export from other formats}
There are two (experimental) scripts which may be used to generate \LaTeX-code with plot coordinates or to simplify format conversion. They are not necessary to run \PGFPlots.

\subsection{pgf2pdf.sh}
This is a unix \texttt{bash}--script which attempts to simplify the workflow of creating PDF-Dokuments for single plots.

\PGF\ provides a method to externalize graphics, meaning to write specific portions of the \LaTeX-file to separate PDF/EPS-files. The script pgf2pdf.sh assumes that portions which need externalization are in files `\texttt{.pgf}' and should be converted to PDF/EPS. Two ways are supported: 
\begin{enumerate}
	\item Run \LaTeX\ on the complete document and write only the portion of interest,
	\item Run \LaTeX\ \emph{only} on the `\texttt{.pgf}'-file. This mode requires a \TeX-file which defines all required commands and includes all required packages (a header).
\end{enumerate}

If you are interested in externalized graphics, you should read\cite[Section~54]{tikz}. You may also type
\begin{lstlisting}
	pgf2pdf.sh --help.
\end{lstlisting}
This script is experimental.

\subsection{matlab2pgfplots.m}
This is a matlab (tm) script which attempts to convert a matlab figure to \PGFPlots.

The idea is to
\begin{itemize}
	\item use a complete matlab figure as input,
	\item acquire axis labels, axis scaling (log or normal) and legend entries,
	\item acquire all plot coordinates
\end{itemize}
and write an equivalent \texttt{.pgf} file which typesets the plot with \PGFPlots.

The indention is \emph{not} to simulate matlab. It is a first step for a conversion. Type
\begin{lstlisting}
> help matlab2pgfplots
\end{lstlisting}
on your matlab prompt for more information about its features and its limitations.

This script is experimental.

\subsection{matlab2pgfplots.sh}
A \texttt{bash}-script which simply starts matlab and runs 
\begin{lstlisting}
	f=hgload( 'somefigure.fig' );
	matlab2pgfplots( 'outputfile.pgf', 'fig', f );
\end{lstlisting}
See matlab2pgfplots.m above.