summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex')
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex73
1 files changed, 57 insertions, 16 deletions
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex
index 3e4c4385723..af80b0ecd3f 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex
@@ -1,6 +1,6 @@
% main=pgfplots.tex
-\section{Drawing axes and plots}
+\section{User's Guide: Drawing Axes and Plots}
\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:
@@ -33,9 +33,47 @@
\end{tabular}%
}
-A small \LaTeX--example file can be found in
\begin{codeexample}[code only]
-doc/latex/pgfplots/pgfplotsexample.tex.
+\documentclass[a4paper]{article}
+
+% for dvipdfm:
+%\def\pgfsysdriver{pgfsys-dvipdfm.def}
+\usepackage{pgfplots}
+\pgfplotsset{compat=newest}% <-- moves axis labels near ticklabels (respects tick label widths)
+
+\begin{document}
+\begin{figure}
+ \centering
+ \begin{tikzpicture}
+ \begin{loglogaxis}[xlabel=Cost,ylabel=Error]
+ \addplot coordinates {
+ (5, 8.31160034e-02)
+ (17, 2.54685628e-02)
+ (49, 7.40715288e-03)
+ (129, 2.10192154e-03)
+ (321, 5.87352989e-04)
+ (769, 1.62269942e-04)
+ (1793, 4.44248889e-05)
+ (4097, 1.20714122e-05)
+ (9217, 3.26101452e-06)
+ };
+ \addplot coordinates {
+ (7, 8.47178381e-02)
+ (31, 3.04409349e-02)
+ (111, 1.02214539e-02)
+ (351, 3.30346265e-03)
+ (1023, 1.03886535e-03)
+ (2815, 3.19646457e-04)
+ (7423, 9.65789766e-05)
+ (18943, 2.87339125e-05)
+ (47103, 8.43749881e-06)
+ };
+ \legend{Case 1,Case 2}
+ \end{loglogaxis}
+ \end{tikzpicture}
+ \caption{A larger example}
+\end{figure}
+\end{document}
\end{codeexample}
\item[Con{\TeX}t:] |\usemodule[pgfplots]| and
@@ -60,7 +98,7 @@ doc/latex/pgfplots/pgfplotsexample.tex.
\end{tabular}%
}
-A small Con{\TeX}t--example file can be found in
+A complete Con{\TeX}t--example file can be found in
\begin{codeexample}[code only]
doc/context/pgfplots/pgfplotsexample.tex.
\end{codeexample}
@@ -87,16 +125,16 @@ doc/context/pgfplots/pgfplotsexample.tex.
\end{tabular}%
}
-A small plain--\TeX--example file can be found in
+A complete plain--\TeX--example file can be found in
\begin{codeexample}[code only]
doc/plain/pgfplots/pgfplotsexample.tex.
\end{codeexample}
\end{description}
-You may need to set low--level drivers if you intend to use |dvipdfm|, see section~\ref{sec:drivers}.
+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}).
-\subsection{A first plot}
-Plotting is done using \lstinline|\begin{axis} ... \addplot ...; \end{axis}|, where |\addplot| is an interface to the \Tikz\ |plot| commands.
+\subsection{A First Plot}
+Plotting is done using \lstinline|\begin{axis} ... \addplot ...; \end{axis}|, where |\addplot| is the main interface to perform plotting operations.
\begin{codeexample}[]
\begin{tikzpicture}
\begin{axis}[
@@ -141,9 +179,9 @@ Plotting is done using \lstinline|\begin{axis} ... \addplot ...; \end{axis}|, wh
\end{tikzpicture}
\end{codeexample}
-The |plot coordinates|, |plot gnuplot| and |plot expression| 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 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}
+\subsection{Two Plots in the Same Axis}
Multiple |\addplot|-commands can be placed into the same axis.
% generated with this statement:
%\addplot plot[id=filesuffix_noise,domain=-6:5,samples=10] gnuplot{(-x**5 - 242 + (-300 + 600*rand(0)))};
@@ -155,7 +193,7 @@ Multiple |\addplot|-commands can be placed into the same axis.
grid=major,
]
- \addplot plot[id=filesuffix] gnuplot{(-x**5 - 242)};
+ \addplot gnuplot[id=filesuffix]{(-x**5 - 242)};
\addlegendentry{model}
\addplot coordinates {
@@ -175,8 +213,8 @@ Multiple |\addplot|-commands can be placed into the same axis.
\end{codeexample}
A legend entry is generated if there are |\addlegendentry| commands (or one |\legend| command).
-\subsection{Logarithmic plots}
-Logarithmic plots show $\log x$ versus $\log y$ (or just one logarithmic axis). \PGFPlots\ always uses the natural logarithm, i.e. basis $e\approx2.718$. Now, the axis description also contains minor ticks and the labels are placed at $10^i$.
+\subsection{Logarithmic Plots}
+Logarithmic plots show $\log x$ versus $\log y$ (or just one logarithmic axis). \PGFPlots\ normally uses the natural logarithm, i.e. basis $e\approx2.718$ (see the key |log basis x|). Now, the axis description also contains minor ticks and the labels are placed at $10^i$.
\begin{codeexample}[]
\begin{tikzpicture}
\begin{loglogaxis}[xlabel=Cost,ylabel=Gain]
@@ -265,9 +303,10 @@ which is the same as |\begin{semilogyaxis}...\end{semilogyaxis}|.
\end{tikzpicture}%
\end{codeexample}
-\subsection{Cycling line styles}
+\subsection{Cycling Line Styles}
You can skip the style arguments for |\addplot[...]| to determine plot specifications from a predefined list:
\label{page:plotcoords:src}%
+\pgfmanualpdflabel{\textbackslash plotcoords}{}%
\begin{codeexample}[width=4cm]
\begin{tikzpicture}
\begin{loglogaxis}[
@@ -308,9 +347,9 @@ You can skip the style arguments for |\addplot[...]| to determine plot specifica
\end{tikzpicture}
\end{codeexample}
\noindent
-The cycle list can be modified, see the reference below.
+The |cycle list| can be modified, see the reference below.
-\subsection{Scaling plots}
+\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.
\begin{codeexample}[]
@@ -359,4 +398,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.
+
\endinput