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.tex38
1 files changed, 27 insertions, 11 deletions
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex
index c81d1a1268e..9bdbed56dff 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex
@@ -7,7 +7,7 @@
\begin{description}
\def\HEAD{%
\small
- \lstset{boxpos=b,breaklines=false,aboveskip=3pt,belowskip=3pt}%
+ %\lstset{boxpos=b,breaklines=false,aboveskip=3pt,belowskip=3pt}%
%\hspace{-1cm}%
\begin{tabular}{*{2}{p{4cm}}}%
}%
@@ -101,7 +101,6 @@ Plotting is done using \lstinline|\begin{axis} ... \addplot ...; \end{axis}|, wh
\begin{tikzpicture}
\begin{axis}[
xlabel=Cost,
- name=an axis,
ylabel=Error]
\addplot[color=red,mark=x] coordinates {
(2,-2.8559703)
@@ -116,23 +115,38 @@ Plotting is done using \lstinline|\begin{axis} ... \addplot ...; \end{axis}|, wh
\end{tikzpicture}
\end{codeexample}
+
\begin{codeexample}[]
-\begin{tikzpicture}%
+\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,
- ylabel=$\sin(x)$,
- name=an axis,
+ ylabel={$f(x) = x^2 - x +4$}
]
- \addplot plot[id=sin] function{sin(x)};
+ % use TeX as calculator:
+ \addplot {x^2 - x +4};
\end{axis}
-\end{tikzpicture}%
+\end{tikzpicture}
+\end{codeexample}
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{axis}[
+ xlabel=$x$,
+ ylabel=$\sin(x)$
+ ]
+ % invoke external gnuplot as
+ % calculator:
+ \addplot gnuplot[id=sin]{sin(x)};
+ \end{axis}
+\end{tikzpicture}
\end{codeexample}
-The |plot coordinates| and |plot function| commands are two of the several \Tikz\ 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 function}.}. The options `|xlabel|' and `|ylabel|' define axis descriptions.
+
+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| and |plot table|). 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.
% generated with this statement:
- %\addplot plot[id=filesuffix_noise,domain=-6:5,samples=10] function{(-x**5 - 242 + (-300 + 600*rand(0)))};
+ %\addplot plot[id=filesuffix_noise,domain=-6:5,samples=10] gnuplot{(-x**5 - 242 + (-300 + 600*rand(0)))};
\begin{codeexample}[leave comments]
\begin{tikzpicture}
\begin{axis}[
@@ -141,7 +155,7 @@ Multiple |\addplot|-commands can be placed into the same axis.
grid=major,
]
- \addplot plot[id=filesuffix] function{(-x**5 - 242)};
+ \addplot plot[id=filesuffix] gnuplot{(-x**5 - 242)};
\addlegendentry{model}
\addplot coordinates {
@@ -298,7 +312,7 @@ 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.
-{%
+
\begin{codeexample}[]
\begin{tikzpicture}[scale=0.5]
\begin{loglogaxis}[
@@ -344,3 +358,5 @@ However, you can also scale plots by assigning a |width=5cm| and/or |height=3cm|
\end{loglogaxis}
\end{tikzpicture}
\end{codeexample}
+
+\endinput