summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex')
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex131
1 files changed, 124 insertions, 7 deletions
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex
index 1525e0fe6bb..a35ef1b049f 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex
@@ -631,6 +631,57 @@ Here, |ybar| yields |/pgfplots/ybar| because it is an argument to the axis, not
\end{pgfplotskey}
+ \begin{pgfplotskey}{hist/density=\marg{true,false} (initially false)}
+ \textit{An extension by J\"urnjakob Dugge}
+ \vskip\baselineskip
+ Enables density estimation mode. If |hist/density| is active, the resulting data points will be renormalized such that the overall ``mass'' equals~$1$.
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[small,ymin=0,title=\texttt{hist}]
+\addplot [
+ hist,
+ fill=orange!75,
+ draw=orange!50!black]
+ table [y index=0] {plotdata/pgfplots.randn.dat};
+\end{axis}
+\end{tikzpicture}
+%
+\begin{tikzpicture}
+\begin{axis}[small,ymin=0, title=\texttt{hist=density}]
+\addplot [
+ hist=density,
+ fill=orange!75,
+ draw=orange!50!black]
+ table [y index=0] {plotdata/pgfplots.randn.dat};
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+
+
+ The keys |hist/density| and |hist/cumulative| can be combined as well:
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[small,ymin=0, title=\texttt{hist=cumulative}]
+\addplot [
+ hist=cumulative,
+ fill=orange!75,
+ draw=orange!50!black]
+ table [y index=0] {plotdata/pgfplots.randn.dat};
+\end{axis}
+\end{tikzpicture}
+%
+\begin{tikzpicture}
+\begin{axis}[small,ymin=0, title=\texttt{hist=\{cumulative,density\}}]
+\addplot [
+ hist={cumulative,density},
+ fill=orange!75,
+ draw=orange!50!black]
+ table [y index=0] {plotdata/pgfplots.randn.dat};
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ \end{pgfplotskey}
+
\begin{stylekey}{/pgfplots/hist/handler (initially ybar interval)}
Allows to change the way the generated coordinates are visualized. The |hist/handler| key is a style, so use |hist/handler/.style={const plot}| to change it.
\end{stylekey}
@@ -800,13 +851,13 @@ Comb plots are very similar to bar plots except that they employ single horizont
% unexpected results here!
variable=\t,
quiver={
- u={cos(deg(t))},
- v={-sin(deg(t))},
+ u={-sin(deg(t))},
+ v={cos(deg(t))},
scale arrows=0.5},
->,blue]
- ({sin(deg(t))}, {cos(deg(t))});
+ ({cos(deg(t))}, {sin(deg(t))});
\addplot[samples=100, domain=0:2*pi]
- ({sin(deg(x))}, {cos(deg(x))});
+ ({cos(deg(x))}, {sin(deg(x))});
\end{axis}
\end{tikzpicture}
\end{codeexample}
@@ -861,9 +912,38 @@ Comb plots are very similar to bar plots except that they employ single horizont
\begin{stylekey}{/pgfplots/quiver/every arrow (initially empty)}
Allows to provide individual arrow styles.
- The style can contain any \Tikz\ drawing option. It might depend upon |mapped color| (provided |point meta| has been set).
+ The style can contain any \Tikz\ drawing option. It will be evaluated for every individual arrow and may depend upon anything which is available at visualization time.
+
+ In particular, this includes |point meta| data, typically using |\pgfplotspointmetatransformed| $\in [0,1000]$ where~$0$ corresponds to |point meta min| and~$1000$ corresponds to |point meta max|:
+\begin{codeexample}[]
+\begin{tikzpicture}
+% define some constants:
+\def\U{1}
+\def\V{2*x}
+\def\LEN{(sqrt((\U)^2 + (\V)^2)}
+
+\begin{axis}[axis equal image,
+ title=Thickness indicates ``strength''.
+]
+\addplot[blue,
+ point meta={\LEN},
+ quiver={
+ u={(\U)/\LEN}, v={(\V)/\LEN},
+ scale arrows=2,
+ every arrow/.append style={
+ line width=2pt*\pgfplotspointmetatransformed/1000
+ },
+ },
+ -stealth,samples=15,
+] {x^2};
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ \noindent In the example, we have some 2d vector field stored in helper constants |\U| and |\V|. The length of each vector is stored in |\LEN| here. The |quiver| plot as such contains unit length vectors -- and the |\LEN| enters an |every arrow| style to get varying |line width|.
+
+ An |every arrow| style might also depend upon |mapped color| (provided |point meta| has been set).
- Again, if you don't need individual arrow styles, prefer using a plot style (|cycle list| or argument to |\addplot|) which is more efficient.
+ Again, if you do not need individual arrow styles, prefer using a plot style (|cycle list| or argument to |\addplot|) which is more efficient.
\end{stylekey}
\begin{pgfplotsxycodekeylist}{%
@@ -871,6 +951,24 @@ Comb plots are very similar to bar plots except that they employ single horizont
quiver/after arrow}%
Advanced keys for more fine tuning of the display. They allow to install some \TeX\ code manually before or after the drawing operations for single arrows. Both are initially empty.
\end{pgfplotsxycodekeylist}
+
+ \begin{stylekey}{/pgfplots/quiver/quiver legend}
+ A style which redefines |legend image code| in order to produce a suitable legend for |quiver| plots.
+
+ It is implicitly activated whenever |quiver| plot handlers are selected.
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[tiny]
+\addplot[blue,
+ quiver={u=1,v=3*x},
+ -stealth,
+ samples=15]
+ {x^3};
+\addlegendentry{Legend}
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ \end{stylekey}
\end{plottype}
\subsubsection{Stacked Plots}
@@ -1584,7 +1682,26 @@ Please note that |\ifdim| compares \TeX\ lengths, so the example employs the suf
\subsubsection{Interrupted Plots}
\index{Interrupted Plots}%
\label{pgfplots:interrupt}%
-Sometimes it is desirable to draw parts of a single plot separately, without connection between the parts (discontinuities). This can be achieved using the |unbounded coords| key combined with coordinate values |nan|, |inf| or |-inf|.
+Sometimes it is desirable to draw parts of a single plot separately, without connection between the parts (discontinuities). \PGFPlots\ offers two ways to generate interrupted plots: either using |empty line|s or by providing |unbounded coords|.
+
+The first way is simple; it needs no extra key (only |\pgfplotsset{compat=1.4}| or newer in your preamble):
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[
+ title=Interrupted data plot]
+
+ \addplot coordinates {
+ (0,0) (10,50) (20,100) (30,200)
+
+ (50,600) (60,800) (80,1000)
+ };
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+\noindent Here, \PGFPlots\ runs with the default configuration |empty line=auto| which interpretes empty lines as ``jump'' markers. This works for any data input method, i.e.\ using |\addplot coordinates|, |\addplot table|, and |\addplot file|.
+
+
+The second way to generate interrupted plots addresses the case where |empty line|s are unavailable or impossible (due to limitations of the tool generating the data file, for example). In this case, interrupted plots can be achieved using the |unbounded coords| key combined with coordinate values |nan|, |inf| or |-inf|.
\begin{pgfplotskey}{unbounded coords=\mchoice{discard,jump} (initially discard)}
This key configures what to do if one or more coordinates of a single point are unbounded. Here, unbounded means it is either $\pm \infty$ (|+inf| or |-inf|) or it has the special ``not--a--number'' value |nan|.