summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.closingplots.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-01-03 01:14:11 +0000
committerKarl Berry <karl@freefriends.org>2010-01-03 01:14:11 +0000
commit98837e31bcd7413ffa40c85ebbce9aa3ff3fdbed (patch)
tree1ed7f18cb8a81bb3f209bf158a38f5b624c2d607 /Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.closingplots.tex
parent080069f58e2325db5ab0ac5f5ea584f3021bc383 (diff)
pgfplots 1.3 (2jan10)
git-svn-id: svn://tug.org/texlive/trunk@16576 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.closingplots.tex')
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.closingplots.tex35
1 files changed, 35 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.closingplots.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.closingplots.tex
new file mode 100644
index 00000000000..d201284ac15
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.closingplots.tex
@@ -0,0 +1,35 @@
+
+
+\subsection{Closing Plots (Filling the Area Under Plots)}
+\begin{command}{\closedcycle}
+ Provide |\closedcycle| as \meta{trailing path commands} after |\addplot| to draw a closed line from the last plot coordinate to the first one.
+
+ Use |\closedcycle| whenevery you intend to fill the area under a plot.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{axis}
+ \addplot {x^2+2} \closedcycle;
+ \end{axis}
+\end{tikzpicture}
+\end{codeexample}
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{axis}
+ \addplot+[fill] {x^2+2} \closedcycle;
+ \end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ In case of stacked plots, |\closedcycle| connects the current plot with the previous plot instead of connecting with the $x$~axis\footnote{The implementation for stacked plots requires some additional logic to determine the filled area: \lstinline{\\closedcycle} will produce a \texttt{plot coordinates} command with \emph{reversed} coordinates of the previous plot. This is usually irrelevant for end users, but it assumes that the plot's type is symmetric. Since constant plots are inherently unsymmetric, \lstinline{\\closedcycle} will use \texttt{const plot mark right} as reversed sequence for \texttt{const plot mark left}.}.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{axis}[stack plots=y]
+ \addplot+[fill] coordinates
+ {(0,1) (1,1) (2,2) (3,2)} \closedcycle;
+ \addplot+[fill] coordinates
+ {(0,1) (1,1) (2,2) (3,2)} \closedcycle;
+ \end{axis}
+\end{tikzpicture}
+\end{codeexample}
+\end{command}