summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pgfplots/pgfplots.importexport.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/pgfplots/pgfplots.importexport.tex')
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.importexport.tex362
1 files changed, 304 insertions, 58 deletions
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.importexport.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.importexport.tex
index e4d0099f383..070f573d1e2 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.importexport.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.importexport.tex
@@ -1,150 +1,393 @@
-\section{Import/Export from other formats}
+\section{Import/Export From Other Formats}
\label{sec:pgfplots:importexport}
This section contains information of how to single pictures into separate \pdf\ graphics files (or \eps\ graphics files). Furthermore, it explains a matlab (tm) script which allows to convert from matlab to \PGFPlots.
\subsection[Export to pdf/eps]{Export to {\normalfont\pdf/\eps}}
+\label{sec:pgfplots:export}
It is possible to export images to single \pdf-documents using routines of \pgfname\ and/or \Tikz.
-\subsubsection[Using the Externalization framework of pgf by hand]{Using the Externalization framework of {\normalfont\pgfname} ``by hand''}
-The first way to export \TeX-pictures to single graphics files is to use the externalization framework of \pgfname.
-The basic idea is to encapsulate the desired parts with
+\subsubsection{Using the Automatic Externalization Framework of \Tikz}
+\begin{pgfplotslibrary}{external}
+\pgfkeys{
+ /pdflinks/search key prefixes in/.add={/tikz/external/,}{}
+}
+ The |external| library offers a convenient method to export every single |tikzpicture| into a separate~|.pdf| (or~|.eps|). Later runs of \LaTeX\ will simply include these graphics, thereby reducing typesetting time considerably.
-|\beginpgfgraphicnamed|\marg{output file name}
+ The library can also be used to submit documents to authors who do not even have \PGFPlots\ or \Tikz\ installed.
-\meta{picture contents}
+ \paragraph{Technical foreword:}
+ The |external| library has been written by Christian Feuers\"anger (author of \PGFPlots). It has been contributed to \Tikz\ as general purpose library, so the reference documentation along with all tweaks can be found in~\cite[Section ``Externalization Library'']{tikz}. The command |\usepgfplotslibrary{external}| is actually just a wrapper which loads |\usetikzlibrary{external}| or, if this library does not yet exist because the installed \pgfname\ has at most version $2.00$, it will load a copy which is shipped with \PGFPlots.
-|\endpgfgraphicnamed|.
+ The |external| library has been designed such that \emph{no changes} to the document as such are necessary. The idea is as follows:
+\begin{enumerate}
+ \item Every |\begin{tikzpicture}| $\dotsc$ |\end{tikzpicture}| gets a file name. The file name can be assigned manually with |\tikzsetnextfilename|\marg{output file name} or automatically, in which case \meta{tex file name}|-figure|\meta{number} is used with an increasing \meta{number}.
+
+ \item The library writes the resulting images using system calls of the form |pdflatex --jobname |\marg{output file name} automatically, using the write18 system call of \TeX. It is the same framework which can be used to call |gnuplot|.
+\end{enumerate}
+The only steps which are necessary is to use
-\noindent Furthermore, one needs to tell \pgfname\ the name of the main document using
+\pgfmanualpdflabel{\textbackslash tikzexternalize}{}%
+|\usepgfplotslibrary{external}|
-|\pgfrealjobname|\marg{the real job's name}
+|\tikzexternalize|\marg{the main file name}
-\noindent in the preamble. This enables two different modes:
-\begin{enumerate}
- \item The first is the normal typesetting mode. \LaTeX\ checks whether a file named \marg{output file name} with one of the accepted file extensions exists -- if that is the case, the graphics file is included with |\pgfimage| and the \meta{picture contents} is skipped. If no such file exists, the \meta{picture contents} is typeset normally. This mode is applied if |\jobname| equals \marg{the real job's name}.
- \item The second mode applies if |\jobname| equals \marg{output file name}, it initiates the ``conversion mode'' which is used to write the graphics file \marg{output file name}. In this case, \emph{only} \meta{picture contents} is written to |\jobname|, the complete rest of the \LaTeX\ is processed as normal, but it is silently discarded.
-
- This mode needs to be started manually with |pdflatex --jobname |\meta{output file name} for every externalized graphics file.
-\end{enumerate}
-A complete example may look as follows.
+\noindent where \meta{the main file name} is the name of your |.tex| file (without the extension |.tex|). No further modification to the document is necessary. Suppose we have a file called |test.tex|:
\begin{codeexample}[code only]
\documentclass{article}
\usepackage{pgfplots}
-\pgfrealjobname{test}
+\usepgfplotslibrary{external}
+\tikzexternalize{test}
\begin{document}
\begin{figure}
- \beginpgfgraphicnamed{testfigure}
\begin{tikzpicture}
\begin{axis}
\addplot {x^2};
\end{axis}
\end{tikzpicture}
- \endpgfgraphicnamed
\caption{Our first external graphics example}
\end{figure}
\begin{figure}
- \beginpgfgraphicnamed{testfigure2}
\begin{tikzpicture}
\begin{axis}
\addplot {x^3};
\end{axis}
\end{tikzpicture}
- \endpgfgraphicnamed
\caption{A second graphics}
\end{figure}
\end{document}
\end{codeexample}
-\noindent The file is named |test.tex|, and it is processed (for example) with
+\noindent To enable the system calls, we type
\begin{codeexample}[code only]
-pdflatex test
+pdflatex -shell-escape test
\end{codeexample}
-\noindent Now, we type
+\noindent and \LaTeX\ will now generate the required graphics files |test-figure0.pdf| and |test-figure1.pdf| automatically. Any further call to |pdflatex| will simply use |\includegraphics| and the |tikzpicture|s as such are no longer considered.
+
+If a figure shall be remade, one can simply delete all or selected graphics files and re-generate them. Alternatively, one can use the command |\tikzset{external/force remake}| somewhere in the document to remake every following picture automatically.
+
+There are three ways to modify the file names of externalized figures:
+\begin{itemize}
+ \item Changing the overall file name using a |prefix|,
+ \item Changing the file name for a single figure using |\tikzsetnextfilename|,
+ \item Changing the file name for a restricted set of figures using |figure name|.
+\end{itemize}
+\begin{key}{/tikz/external/prefix=\marg{file name prefix} (initially empty)}
+ A shortcut for |\tikzsetexternalprefix|\marg{file name prefix}, see below.
+\end{key}
+
+\begin{command}{\tikzsetexternalprefix\marg{file name prefix}}
+ Assigns a common prefix used by all file names. For example,
\begin{codeexample}[code only]
-pdflatex --jobname testfigure test
-pdflatex --jobname testfigure2 test
+\tikzsetexternalprefix{figures/}
\end{codeexample}
-\noindent to enter conversion mode. These last calls will \emph{only} write the contents of our named graphics environments, one for \marg{testfigure} and one for \marg{testfigure2} into the respective output files |testfigure.pdf| and |testfigure2.pdf|.
+ will prepend |figures/| to every external graphics file name.
+\end{command}
-In summary, one needs |\pgfrealjobname| and calls |pdflatex --jobname |\marg{graphics file} for every externalized graphics environment. Please note that it is absolutely necessary to use the syntax above, \emph{not} |\begin{pgfgraphicnamed}|.
+\begin{command}{\tikzsetnextfilename\marg{file name}}
+ Sets the file name for the \emph{next} \tikzname\ picture or |\tikz| short command. It will \emph{only} be used for the next picture.
-These steps are explained in much more detail in Section``Externalizing Graphics'' of~\cite{tikz}. This reference also contains information about how to typeset such a document without \pgfname\ installed.
+ Pictures for which no explicit file name has been set will get automatically generated file names.
-I once attempted to write a unix \texttt{bash}--script |pgf2pdf.sh| which simplifies these steps in case that every externalized graphics environment is placed into a separate file |.pgf|. Interested readers find it in the installation tree.
+ Please note that |prefix| will still be prepended to \marg{file name}.
+\begin{codeexample}[code only]
+\documentclass{article}
+% main document, called main.tex
+\usepackage{tikz}
-\paragraph{Attention:} Do not forget a correct |\pgfrealjobname| statement! If it is missing, externalization simply won't work. If it is wrong, any call to \LaTeX\ will produce empty output files.
+\usepgfplotslibrary{external}
+\tikzexternalize[prefix=figures/]{main} % provide the file's real name
-\subsubsection{Using the automatic Externalization framework of \Tikz}
-It is also possible to externalize graphics with the high-level library
+\begin{document}
-|\usetikzlibrary{external}|
+\tikzsetnextfilename{firstplot}
+\begin{tikzpicture} % will be written to 'figures/firstplot.pdf'
+\begin{axis}
+ \addplot {x};
+\end{axis}
+\end{tikzpicture}
-\noindent which comes with (very recent versions of) \Tikz. At the time of this writing, it is \textbf{only available in the CVS~$2.0$ version of} \pgfname, sorry. It is a front-end for |\beginpgfgraphicnamed| which automatically encapsulates every picture in your document with the required externalization commands and performs commands to generate all required graphics files.
-\begin{enumerate}
- \item Every |\begin{tikzpicture}| $\dotsc$ |\end{tikzpicture}| gets a file name. The file name can be assigned manually with |\tikzsetnextfilename|\marg{output file name} or automatically, in which case \meta{tex file name}|-figure|\meta{number} is used with an increasing \meta{number}.
+\begin{tikzpicture} % will be written to 'figures/main-figure0.pdf'
+ \draw[help lines] (0,0) grid (5,5);
+\end{tikzpicture}
+\end{document}
+\end{codeexample}
+\begin{codeexample}[code only]
+pdflatex -shell-escape main
+\end{codeexample}
+\end{command}
+
+\begin{key}{/tikz/external/figure name=\marg{name}}
+ Same as |\tikzsetfigurename|\marg{name}.
+\end{key}
+\begin{command}{\tikzsetfigurename\marg{name}}
+ Changes the names of \emph{all} following figures. It is possible to change |figure name| during the document using |\tikzset{external/figure name|=\marg{name}|}|. A unique counter\footnote{These counters are stored into into different \emph{macros}. In other words: no \TeX\ register will be needed.} will be used for each different \marg{name}, and each counter will start at $0$.
+
+ The value of |prefix| will be applied after |figure name| has been evaluated.
+\begin{codeexample}[code only]
+\documentclass{article}
+% main document, called main.tex
+\usepackage{tikz}
+
+\usepgfplotslibrary{external}
+\tikzexternalize{main} % provide the file's real name
+
+\begin{document}
+
+% will be written to 'main-figure0.pdf'
+\begin{tikzpicture}
+\begin{semilogyaxis}
+ \addplot {exp(x)};
+\end{semilogyaxis}
+\end{tikzpicture}
+
+{
+ \tikzset{external/figure name={subset_}}
+ A simple image is \tikz \fill (0,0) circle(5pt);. % will be written to 'subset_0.pdf'
+
+ \begin{tikzpicture} % will be written to 'subset_1.pdf'
+ \begin{axis}
+ \addplot {x^2};
+ \end{axis}
+ \end{tikzpicture}
+}% here, the old file name will be restored:
+
+\begin{tikzpicture} % will be written to 'main-figure1.pdf'
+ \begin{axis}
+ \addplot[domain=1e-3:100] {1/x};
+ \end{axis}
+\end{tikzpicture}
+\end{document}
+\end{codeexample}
+ The scope of |figure name| ends with the next closing brace (as all values set by |\tikzset| do).
+
+ \medbreak
+ Remark: Use |\tikzset{external/figure name/.add=|\marg{prefix}\marg{suffix}|}| to prepend a \meta{prefix} and append a \meta{suffix} to the actual value of |figure name|. Might be useful for something like
+\begin{codeexample}[code only]
+\tikzset{external/figure name=main}
+
+% uses main_0.pdf, main_1.pdf, ...
+
+\section{The first section}
+{\tikzset{external/figure name/.add={}{_firstsection}}
+ ...
+ % uses main_firstsection_0.pdf, main_firstsection_1.pdf, ...
+}
+
+\section{The second section}
+{\tikzset{external/figure name/.add={}{secondsection_}}
+ ...
+ % uses main_secondsection_0.pdf, main_secondsection_1.pdf, ...
+ \subsection{Second subsection}
+ {\tikzset{external/figure name/.add={}{sub_}}
+ ...
+ % uses main_secondsection_sub_0.pdf, main_secondsection_sub_1.pdf, ...
+ }
+ % uses main_secondsection_2.pdf, main_secondsection_3.pdf, ...
+}
+\end{codeexample}
+\end{command}
+
+
+\begin{key}{/tikz/external/system call=\marg{template}}
+\label{extlib:systemcall:option}
+ A template string used to generate system calls. Inside of \marg{template}, the macro |\image| can be used as placeholder for the image which is about to be generated while |\texsource| contains the main file name.
+
+ The default is
+\begin{codeexample}[code only]
+\tikzset{external/system call={pdflatex -shell-escape -halt-on-error
+ -interaction=batchmode -jobname "\image" "\texsource"}
+\end{codeexample}
+
+ For |eps| output, you can (and need to) use
+\begin{codeexample}[code only]
+\tikzset{external/system call={latex -shell-escape -halt-on-error
+ -interaction=batchmode -jobname "\image" "\texsource";
+ dvips -o "\image".ps "\image".dvi}}
+\end{codeexample}
- \item The library issues the required calls to |pdflatex --jobname |\marg{output file name} automatically, using the write18 system call of \TeX. It is the same framework which can be used to call |gnuplot|.
-\end{enumerate}
-The only steps which are necessary is to use
+ The argument \marg{template} will be expanded using |\edef|, so any control sequences will be expanded. During this evaluation, `|\\|' will result in a normal backslash, `|\|'. Furthermore, double quotes `|"|', single quotes `|'|', semicolons and dashes `|-|' will be made to normal characters if any package uses them as macros. This ensures compatibility with the |german| package, for example.
+\end{key}
-|\tikzexternalize|\marg{the job's real file name}
+The complete reference documentation and remaining options are documented in~\cite[``Externalization Library'']{tikz}. This reference also contains information about
+\begin{itemize}
+ \item how to use |\tikzset{external/|\declareandlabel{force remake}|}| and |\tikzset{external/|\declareandlabel{remake next}|}| to remake selected figures,
+ \item how to disable the externalization partially with |\tikzset{external/|\declareandlabel{export}|=false}| or completely with |\tikzexternaldisable|,
+ \item how to optimize the speed of the conversion process using |\tikzset{external/optimize command away=\myExpensiveMacro}|,
+ \item how to use |mode=list and make| to automatically generate makefiles for parallel image externalization\footnote{In case you'd like to test \texttt{list and make}, consider using \texttt{\textbackslash tikzifexternalizing\{\textbackslash nofiles\}\{\}} to suppress \texttt{.aux} file generation during parallel externalization procedures; \texttt{.aux} files would be screwed up otherwise.},
+ \item how to typeset such a document without \pgfname\ installed or
+ \item how to provide work-arounds with |.pdf| images and bounding box restrictions.
+\index{External Graphics!Bounding Box Issues}
+\index{Bounding Box Control!Image Externalization Problems}
+\end{itemize}
+
+\paragraph{Using the Library Without {\normalfont\pgfname} or {\normalfont\PGFPlots} Installed}
+There is a small replacement package \declareandlabel{tikzexternal.sty} which can be used once every figure has been exported. The idea is to uncomment |\usepackage{tikz}| and |\usepackage{pgfplots}| and write |\usepackage{tikzexternal}| instead:
+\begin{codeexample}[code only]
+% \usepackage{tikz}
+% \usepackage{pgfplots}
+\usepackage{tikzexternal}
+\tikzexternalize{test} % <-- provide the main .tex name
+
+\begin{document}
+\begin{tikzpicture}
+ ...
+\end{tikzpicture}
+...
+\end{document}
+\end{codeexample}
+You do not need \pgfname, \tikzname\ or \PGFPlots\ installed. What you need is |tikzexternal.sty| and all generated figures (consisting of the image files, `|.pdf|' and the `|.dpth|' files containing information of the |baseline| option). The file |tikzexternal.sty| is shipped with \pgfname\ in the directory
+\begin{codeexample}[code only]
+latex/pgf/utilities/tikzexternal.sty
+\end{codeexample}
+and a copy is shipped with \PGFPlots\ in
+\begin{codeexample}[code only]
+tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty
+\end{codeexample}
+Just copy the file into your directory and rename it to |tikzexternal.sty|.
+
+\paragraph{Attention:} The small replacement package doesn't support key--value interfaces. Thus, it is necessary to use |\tikzsetexternalprefix| instead of the |prefix| option and |\tikzsetfigurename| instead of the |figure name| option since |\tikzset| is not available in such a context. Also, you may want to define a dummy--macro |\pgfplotsset| if you have used |\pgfplotsset|.
+\end{pgfplotslibrary}
+
+\subsubsection[Using the Externalization Framework of PGF By Hand]{Using the Externalization Framework of {\normalfont\pgfname} ``By Hand''}
+Another way to export \TeX-pictures to single graphics files is to use the externalization framework of \pgfname, which requires more work but works more generally than the |external| library.
+The basic idea is to encapsulate the desired parts with
+
+\declareandlabel{\beginpgfgraphicnamed}\marg{output file name}
+
+\meta{picture contents}
+
+\declareandlabel{\endpgfgraphicnamed}.
-\noindent as above. No further modification to the document is necessary. Now, the example file |test.tex| of the last subsection reads as follows:
+\noindent Furthermore, one needs to tell \pgfname\ the name of the main document using
+
+\declareandlabel{\pgfrealjobname}\marg{the real job's name}
+
+\noindent in the preamble. This enables two different modes:
+\begin{enumerate}
+ \item The first is the normal typesetting mode. \LaTeX\ checks whether a file named \marg{output file name} with one of the accepted file extensions exists -- if that is the case, the graphics file is included with |\pgfimage| and the \meta{picture contents} is skipped. If no such file exists, the \meta{picture contents} is typeset normally. This mode is applied if |\jobname| equals \marg{the real job's name}.
+ \item The second mode applies if |\jobname| equals \marg{output file name}, it initiates the ``conversion mode'' which is used to write the graphics file \marg{output file name}. In this case, \emph{only} \meta{picture contents} is written to |\jobname|, the complete rest of the \LaTeX\ is processed as normal, but it is silently discarded.
+
+ This mode needs to be started manually with |pdflatex --jobname |\meta{output file name} for every externalized graphics file.
+\end{enumerate}
+A complete example may look as follows.
\begin{codeexample}[code only]
\documentclass{article}
\usepackage{pgfplots}
-\usetikzlibrary{external}
-\tikzexternalize{test}
+\pgfrealjobname{test}
\begin{document}
\begin{figure}
+ \beginpgfgraphicnamed{testfigure}
\begin{tikzpicture}
\begin{axis}
\addplot {x^2};
\end{axis}
\end{tikzpicture}
+ \endpgfgraphicnamed
\caption{Our first external graphics example}
\end{figure}
\begin{figure}
+ \beginpgfgraphicnamed{testfigure2}
\begin{tikzpicture}
\begin{axis}
\addplot {x^3};
\end{axis}
\end{tikzpicture}
+ \endpgfgraphicnamed
\caption{A second graphics}
\end{figure}
\end{document}
\end{codeexample}
-\noindent To enable the system calls, we type
+\noindent The file is named |test.tex|, and it is processed (for example) with
\begin{codeexample}[code only]
-pdflatex -shell-escape test
+pdflatex test
\end{codeexample}
-\noindent and \LaTeX\ will now generate the required graphics files |test-figure0.pdf| and |test-figure1.pdf| automatically.
+\noindent Now, we type
+\begin{codeexample}[code only]
+pdflatex --jobname testfigure test
+pdflatex --jobname testfigure2 test
+\end{codeexample}
+\noindent to enter conversion mode. These last calls will \emph{only} write the contents of our named graphics environments, one for \marg{testfigure} and one for \marg{testfigure2} into the respective output files |testfigure.pdf| and |testfigure2.pdf|.
-The command |\tikzset{external/force remake}| somewhere in the document can be used to remake every following picture automatically. Of course, it is also possible to simply delete every graphics file.
+In summary, one needs |\pgfrealjobname| and calls |pdflatex --jobname |\marg{graphics file} for every externalized graphics environment. Please note that it is absolutely necessary to use the syntax above, \emph{not} |\begin{pgfgraphicnamed}|.
+
+These steps are explained in much more detail in Section``Externalizing Graphics'' of~\cite{tikz}.
-The library can also be configured to produce a list of figures in case system calls are undesired (or unavailable). In that case, |pdflatex --jobname |\marg{output file name} needs to be invoked for every file name listed in \meta{real file name}|.figlist|. This step can be done within a script.
+\paragraph{Attention:} Do not forget a correct |\pgfrealjobname| statement! If it is missing, externalization simply won't work. If it is wrong, any call to \LaTeX\ will produce empty output files.
-The command |\tikzsetexternalprefix|\marg{file prefix} can be used to prepend a directory name to every figure, for example with
+It should be noted that this approach of image externalization is not limited to \Tikz\ picture environments. In fact, it collects everything between the begin and end statements into the external file. It is implicitly assumed that the encapsulated stuff is one box, but you can also encapsulate complete paragraphs using something like the \LaTeX\ minipage (or a |\vbox| which is not as powerful but does not affect the remaining document that much).
+
+\paragraph{Using the Library Without {\normalfont\pgfname} Installed}
+Simply uncomment the packages |\usepackage{tikz}| and |\usepackage{pgfplots}| and use
\begin{codeexample}[code only]
-\tikzsetexternalprefix{figures/}
+\long\def\beginpgfgraphicnamed#1#2\endpgfgraphicnamed{%
+ \begingroup
+ \setbox1=\hbox{\includegraphics{#1}}%
+ \openin1=#1.dpth
+ \ifeof1 \box1
+ \else
+ \read1 to\pgfincludeexternalgraphicsdp \closein1
+ \dimen0=\pgfincludeexternalgraphicsdp\relax
+ \hbox{\lower\dimen0 \box1 }%
+ \fi
+ \endgroup
+}
\end{codeexample}
-\noindent to produce |figures/test-figure0.pdf| and |figures/test-figure1.pdf| in our example.
+instead. This will include the generated graphics files (and it will respect the |baseline| information stored in |.dpth| files). Consequently, you won't need \pgfname\ or \PGFPlots\ installed. See Section``Externalizing Graphics'' of~\cite{tikz} for details.
-The complete reference documentation and remaining options are documented in the documentation for the ``PDF externalization library'' of~\cite{tikz}. This reference also contains information about how to typeset such a document without \pgfname\ installed or how to provide work-arounds with |.pdf| images and bounding box restrictions.
-\index{External Graphics!Bounding Box Issues}
-\index{Bounding Box Control!Image Externalization Problems}
+
+\subsection{Exporting Mesh Data From Matlab To \PGFPlots}
+While it is easy to write Matlab vectors to files (using |save P.dat data -ASCII|), it is more involved to export mesh data.
+
+The main problem is to communicate the mesh structure to \PGFPlots.
+
+Here is an example how to realize this task: in Matlab, we have mesh data |X|, |Y| and |Z| which are matrizes of the same size. For example, suppose we have
+
+\begin{codeexample}[code only]
+[X,Y] = meshgrid( linspace(-1,1,5), linspace(4,5,10) );
+Z = X + Y;
+surf(X,Y,Z)
+\end{codeexample}
+\noindent as data. Then, we can generate an $N \times 3$ table containing all single elements in column--wise ordering with
+
+\begin{codeexample}[code only]
+data = [ X(:) Y(:) Z(:) ]
+save P.dat data -ASCII
+\end{codeexample}
+\noindent where the second command stores the $N \times 3$ table into |P.dat|. Finally, we can use
+
+|\addplot3[surf,mesh/rows=10,mesh/ordering=colwise,shader=interp] file {P.dat};|
+
+in \PGFPlots\ to read this data. We need to provide either the number of rows ($10$ here) or the number of columns -- and the ordering (which is |colwise| for Matlab matrizes).
+
+An alternative which is faster in \PGFPlots\ would be to transpose the matrizes in Matlab and tell \PGFPlots\ they are in |rowwise| ordering. So, the last step becomes
+
+\begin{codeexample}[code only]
+XX=X'; YY=Y'; ZZ=Z';
+data = [ XX(:) YY(:) ZZ(:) ]
+save P.dat data -ASCII
+\end{codeexample}
+\noindent with \PGFPlots\ command
+
+|\addplot3[surf,mesh/cols=10,mesh/ordering=rowwise,shader=interp] file {P.dat};|.
\subsection{matlab2pgfplots.m}
This is a Matlab (tm) script which attempts to convert a matlab figure to \PGFPlots. It requires Matlab version 7.4 (or higher).
-The idea is to
+\paragraph{Attention:} The author of \PGFPlots\ does not have enough time to maintain this script as much as he wants to. In other words, it supports only a small subset of \PGFPlots. You may also want to look at |matlab2tikz|, a conversion script of Nico Schl\"omer available at
+
+\url{http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz}
+
+\noindent which also uses \PGFPlots\ for the \LaTeX\ conversion.
+
+\medskip
+The idea of |matlab2pgfplots.m| is to
\begin{itemize}
\item use a complete matlab figure as input,
\item acquire axis labels, axis scaling (log or normal) and legend entries,
@@ -152,7 +395,7 @@ The idea is to
\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
+The intention is \emph{not} to simulate matlab. It is a first step for a conversion. Type
\begin{lstlisting}
> help matlab2pgfplots
\end{lstlisting}
@@ -170,3 +413,6 @@ See matlab2pgfplots.m above.
\subsection{SVG Output}
It is possible to write every single \Tikz\ picture into a scalable vector graphics (\texttt{.svg}) file. This has nothing to do with \PGFPlots, it is a separate driver of \PGF. Please refer to~\cite[Section ``Producing HTML / SVG Output'']{tikz}.
+
+\subsection{Generate \PGFPlots\ Graphics Within Python}
+Mario Orne D\'IAZ ANAD\'ON contributed a small python script |pgfplots.py| which provides a simple interface to generate \PGFPlots\ figures from within python. It can be found in the \PGFPlots\ installation directory, in |pgfplots/scripts/pgfplots/pgfplots.py|; documentation can be found in the file.