diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.specifyrange.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.specifyrange.tex | 56 |
1 files changed, 46 insertions, 10 deletions
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.specifyrange.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.specifyrange.tex index fb074d59ca8..5dc32cc749d 100644 --- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.specifyrange.tex +++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.specifyrange.tex @@ -2,17 +2,17 @@ \subsection{Specifying the Plotted Range} -\begin{pgfplotsxykeylist}{\x min=\marg{coord},\x max=\marg{coord}} -The options |xmin|, |xmax| and |ymin|, |ymax| allow to define the axis limits, i.e.\ the lower left and the upper right corner. Everything outside of the axis limits will be clipped away. +\begin{pgfplotsxykeylist}{\x min=\marg{coord},\x max=\marg{coord},min=\marg{coord},max=\marg{coord}} +These options allow to define the axis limits, i.e.\ the lower left and the upper right corner. Everything outside of the axis limits will be clipped away. -Each missing limit will be determined automatically. +Each of these keys is optional, and missing limits will be determined automatically from input data. Here, the |min| and |max| keys set limits for $x$, $y$ and $z$ to the same \meta{coord}. -If $x$-limits have been specified explicitly and $y$-limits are computed automatically, the automatic computation of $y$-limits will only considers points which fall into the specified $x$-range (and vice--versa). The same holds true if, for example, only |xmin| has been provided explicitly: in that case, |xmax| will be updated only for points for which $x \ge $|xmin| holds. This feature can be disabled using |clip limits=false|. +If $x$-limits have been specified explicitly and $y$-limits are computed automatically, the automatic computation of $y$-limits will only considers points which fall into the specified $x$-range (and vice--versa). The same holds true if, for example, only |xmin| has been provided explicitly: in that case, |xmax| will be updated only for points for which $x \ge \,$|xmin| holds. This feature can be disabled using |clip limits=false|. Axis limits can be increased automatically using the |enlargelimits| option. \begin{codeexample}[] \begin{tikzpicture} - \begin{axis} + \begin{axis}[title=Auto Limits] \addplot {x^2}; \end{axis} \end{tikzpicture} @@ -20,7 +20,7 @@ Axis limits can be increased automatically using the |enlargelimits| option. \begin{codeexample}[] \begin{tikzpicture} - \begin{axis}[xmin=0] + \begin{axis}[title={\texttt{xmin=0}},xmin=0] \addplot {x^2}; \end{axis} \end{tikzpicture} @@ -28,11 +28,38 @@ Axis limits can be increased automatically using the |enlargelimits| option. \begin{codeexample}[] \begin{tikzpicture} - \begin{axis}[ymax=10] + \begin{axis}[title={\texttt{ymax=10}},ymax=10] \addplot {x^2}; \end{axis} \end{tikzpicture} \end{codeexample} + + Note that even if you provide |ymax=10|, data points with $y>10$ will still be visualized -- producing a line which leaves the plotted range. + + See also the |restrict x to domain| and |restrict x to domain*| keys -- they allow to discard or clip input coordinates which are outside of some domain, respectively. + + + During the visualization phase, i.e.\ during |\end{axis}|, these keys will be set to the final axis limits. You can access the values by means of |\pgfkeysvalueof{/pgfplots/xmin}|, for example: +\begin{codeexample}[] +\begin{tikzpicture} +\begin{axis}[ + % Show (automatically) computed limits: + title={ + Axis limits are + $ + [\pgfmathprintnumber{\pgfkeysvalueof{/pgfplots/xmin}} + :\pgfmathprintnumber{\pgfkeysvalueof{/pgfplots/xmax}} + ] \times + [\pgfmathprintnumber{\pgfkeysvalueof{/pgfplots/ymin}} + :\pgfmathprintnumber{\pgfkeysvalueof{/pgfplots/ymax}} + ]$ }, +] + \addplot {x^2}; +\end{axis} +\end{tikzpicture} +\end{codeexample} + \label{page:access:limits} + This access is possible inside of any axis description (like |xlabel|, |title|, |legend entries| etc.) or any annotation (i.e. inside of |\node|, |\draw| or |\path| and coordinates in |(axis cs:|\meta{x}|,|\meta{y}|)|), but not inside of |\addplot| (limits may not be complete at this stage). \end{pgfplotsxykeylist} \begin{pgfplotsxykey}{\x mode=\mchoice{normal,linear,log} (initially normal)} @@ -44,7 +71,7 @@ Axis limits can be increased automatically using the |enlargelimits| option. \begin{pgfplotsxykey}{\x\ dir=\mchoice{normal,reverse} (initially normal)} \pgfkeys{/pdflinks/search key prefixes in/.add={/pgfplots/,}{}} - Allows to revert axis directions such that values are given in decreasing order. + Allows to reverse axis directions such that values are given in decreasing order. \label{key:pgfplots:xydir} \begin{codeexample}[] \begin{tikzpicture} @@ -66,7 +93,7 @@ Axis limits can be increased automatically using the |enlargelimits| option. \end{tikzpicture} \end{codeexample} - Note, that axis descriptions and relative positioning macros will stay at the same place as they would for non--reversed axes. + Note that axis descriptions and relative positioning macros will stay at the same place as they would for non--reversed axes. \begin{codeexample}[] \begin{tikzpicture} \begin{axis}[ @@ -165,6 +192,15 @@ You can set |xmin|, |xmax| and |ymin|, |ymax| to the minimum/maximum values of y \end{pgfplotsxykeylist} +\begin{pgfplotsxykeylist}{% + log origin \x=\mchoice{0,infty} (initially infty),% + log origin=\mchoice{0,infty} (initially infty)}% + Allows to choose which coordinate is the logical ``origin'' of a logarithmic plot (either for a particular axis or for all of them). + + The choice |log origin=infty| is probably useful for stacked plots: it defines the ``origin'' in log--coordinates to be $-\infty$. To be compatibly with older versions, this is the default. + + The choice |log origin=0| defines the logarithmic origin to be the natural choice $\log(1)=0$. This is particularly useful for |ycomb| plots. +\end{pgfplotsxykeylist} \begin{pgfplotskey}{update limits=\mchoice{true,false} (initially true)} Can be used to interrupt updates of the data limits (for example, for single |\addplot| commands). @@ -174,7 +210,7 @@ You can set |xmin|, |xmax| and |ymin|, |ymax| to the minimum/maximum values of y \begin{environment}{{pgfplotsinterruptdatabb}} \index{Bounding Box Control!Disable \protect\emph{data} bounding box modifications} - Everything in \marg{environment contents} will not contribute to the data bounding box. + Everything in \meta{environment contents} will not contribute to the data bounding box. The same effect can be achieved with |update limits=false| inside curly braces. \end{environment} |