diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex index a66239c4b25..aa84de1bdbd 100644 --- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex +++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex @@ -1,9 +1,22 @@ % main=pgfplots.tex \section{User's Guide: Drawing Axes and Plots} + +The user interface of \PGFPlots\ consists of three components: a |tikzpicture| environment, an |axis| and the |\addplot| command. + +Each axis is generated as part of a picture environment (which can be used to annotate plots afterwards, for example). The axis environment encapsulates one or more |\addplot| commands and controls axis-wide settings (like limits, legends, and descriptions). The |\addplot| command supports several coordinate input methods (like table input or mathematical expressions) and allows various sorts of visualization options with straight lines as initial configuration. + +The rest of \PGFPlots\ is a huge set of key--value options to modify the initial configuration or to select plot types. The reference manual has been optimized for electronical display: a lot of examples illustrate the features, and reference documentation can be found by clicking into the sourcecode text fields. Note that most pdf viewers also support to jump back from a hyperlink: for Acrobat Reader, open the menu View$\gg$Toolbars$\gg$More Tools and activate the ``Previous View'' and ``Next View'' buttons (which are under ``Page Navigation Toolbar''). Thus, knowledge of all keys is unnecessary; you can learn them when it is necessary. + +To learn \PGFPlots, you should learn about the |\addplot| command and its coordinate input methods. The most important input methods are \verbpdfref{\addplot table} and \verbpdfref{\addplot expression}. + +The following sections explain the basics of \PGFPlots, namely how to work with the |\addplot| commands and |axis| environments and how line styles are assigned automatically. + \subsection{\TeX-dialects: \LaTeX, Con{\TeX}t, plain \TeX } \label{sec:tex:dialects}% -\PGFPlots\ is compatible with \LaTeX, Con{\TeX}t and plain \TeX. The only difference is how to specify environments. This affects any \PGF/\Tikz-environments and all \PGFPlots-environments like axis, semilogxaxis, semilogyaxis and loglogaxis: +The starting point for \PGFPlots\ is an |axis| enviroment like |axis| or the logarithmic variants |semilogxaxis|, |semilogyaxis| or |loglogaxis|. + +Each environment is available for \LaTeX, Con{\TeX}t and plain \TeX: \begin{description} \def\HEAD{% \small @@ -130,11 +143,12 @@ A complete plain--\TeX--example file can be found in doc/plain/pgfplots/pgfplotsexample.tex. \end{codeexample} \end{description} -The default system drivers for |dvips| and |pdftex| work without any additional work; for |dvipdfm|, the |pgfsysdriver| macro needs to be redefined manually (see also section~\ref{sec:drivers}). + +If you use |latex| / |dvips| or |pdflatex|, no further modifications are necessary. For |dvipdfm|, you should use the |\def\pgfsysdriver| line as indicated above in the examples (see also Section~\ref{sec:drivers}). \subsection{A First Plot} -Plotting is done using \lstinline|\begin{axis} ... \addplot ...; \end{axis}|, where |\addplot| is the main interface to perform plotting operations. +Plotting is done using |\begin{axis} ... \addplot ...; \end{axis}|, where |\addplot| is the main interface to perform plotting operations. \begin{codeexample}[] \begin{tikzpicture} \begin{axis}[ @@ -179,10 +193,10 @@ Plotting is done using \lstinline|\begin{axis} ... \addplot ...; \end{axis}|, wh \end{tikzpicture} \end{codeexample} -The |plot coordinates|, |plot expression| and |plot gnuplot| commands are three of the several supported ways to create plots, see section~\ref{sec:addplot} for more details\footnote{Please note that you need \lstinline{gnuplot} installed to use \lstinline{plot gnuplot}.} and the remaining ones (|plot file|, |plot shell|, |plot table| and |plot graphics|). The options `|xlabel|' and `|ylabel|' define axis descriptions. +The |plot coordinates|, |plot expression| and |plot gnuplot| commands are three of the several supported ways to create plots, see Section~\ref{sec:addplot} for more details\footnote{Please note that you need \lstinline{gnuplot} installed to use \lstinline{plot gnuplot}.} and the remaining ones (|plot file|, |plot shell|, |plot table| and |plot graphics|). The options `|xlabel|' and `|ylabel|' define axis descriptions. \subsection{Two Plots in the Same Axis} -Multiple |\addplot|-commands can be placed into the same axis. +Multiple |\addplot|-commands can be placed into the same axis, and a |cycle list| is used to automatically select different line styles: % generated with this statement: %\addplot plot[id=filesuffix_noise,domain=-6:5,samples=10] gnuplot{(-x**5 - 242 + (-300 + 600*rand(0)))}; \begin{codeexample}[leave comments] @@ -193,7 +207,7 @@ Multiple |\addplot|-commands can be placed into the same axis. grid=major, ] - \addplot gnuplot[id=filesuffix]{(-x**5 - 242)}; + \addplot {-x^5 - 242}; \addlegendentry{model} \addplot coordinates { @@ -243,7 +257,7 @@ Level Cost Error 8 18943 2.873e-05 9 47103 8.437e-06 \end{codeexample} -then we can plot |Cost| versus |Error| using +\noindent then we can plot |Cost| versus |Error| using \begin{codeexample}[] \begin{tikzpicture} \begin{loglogaxis}[ @@ -350,7 +364,7 @@ You can skip the style arguments for |\addplot[...]| to determine plot specifica The |cycle list| can be modified, see the reference below. \subsection{Scaling Plots} -You can use any of the \Tikz\ options to modify the appearance. For example, the ``|scale|'' transformation takes the picture as such and scales it. +You can use any of the \Tikz\ options to modify the appearance. For example, the ``|scale|'' transformation takes the picture as such and scales it (just like |\includegraphics|): \begin{codeexample}[] \begin{tikzpicture}[scale=0.5] @@ -398,6 +412,6 @@ However, you can also scale plots by assigning a |width=5cm| and/or |height=3cm| \end{tikzpicture} \end{codeexample} -Use the predefined styles |normalsize|, |small|, |footnotesize| to adopt font sizes and ticks automatically. +Use the predefined styles |normalsize|, |small|, |footnotesize| to adopt font sizes and ticks automatically. Use the |/pgfplots/scale| key to rescale the axis without affecting fonts. \endinput |