diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.tickoptions.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.tickoptions.tex | 88 |
1 files changed, 53 insertions, 35 deletions
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.tickoptions.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.tickoptions.tex index 228d9d8533a..a60d6774e55 100644 --- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.tickoptions.tex +++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.tickoptions.tex @@ -4,18 +4,18 @@ \subsubsection{Tick Coordinates and Label Texts} \begin{pgfplotsxykey}{\x tick=\mchoice{\textbackslash empty,data,\normalfont\marg{coordinate list}} (initially \marg{})} -These options assign a list of \emph{Positions} where ticks shall be placed. The argument is either the empty string (which is the initial value), the command |\empty|, |data| or a list of coordinates. The initial configuration of an empty string means to generate these positions automatically. The choice |\empty| will result in no tick at all. The special value |data| will produce tick marks at every coordinate of the first plot. Otherwise, tick marks will be placed at every coordinate in \marg{coordinate list}. +These options assign a list of \emph{positions} where ticks shall be placed. The argument is either the empty string (which is the initial value), the command |\empty|, the special string `|data|' or a list of coordinates. The initial configuration of an empty string means to generate these positions automatically. The choice |\empty| will result in no tick at all. The special value `|data|' will produce tick marks at every coordinate of the first plot. Otherwise, tick marks will be placed at every coordinate in \meta{coordinate list}. -The \marg{coordinate list} will be used inside of a |\foreach \x in |\marg{coordinate list} statement. The format is as follows: +The \meta{coordinate list} will be used inside of a |\foreach \x in |\marg{coordinate list} statement. The format is as follows: \begin{itemize} \item |{0,1,2,5,8,1e1,1.5e1}| (a series of coordinates), \item |{0,...,5}| (the same as |{0,1,2,3,4,5}|), \item |{0,2,...,10}| (the same as |{0,2,4,6,8,10}|), \item |{9,...,3.5}| (the same as |{9, 8, 7, 6, 5, 4}|), \item See \cite[Section~34]{tikz} for a more detailed definition of the options. - \item Please be careful with white spaces inside of \marg{coordinate list} (at least around the dots). + \item Please be careful with white spaces inside of \meta{coordinate list} (at least around the dots). \end{itemize} -For logplots, \PGFPlots\ will apply $\log(\cdot)$ to each element in `\marg{coordinate list}'. +For logplots, \PGFPlots\ will apply $\log(\cdot)$ to each element in `\meta{coordinate list}' (similarly, any custom transformations are applied to the argument list). \begin{codeexample}[] \begin{tikzpicture} \begin{loglogaxis}[xtick={12,9897,1468864}] @@ -41,10 +41,10 @@ For logplots, \PGFPlots\ will apply $\log(\cdot)$ to each element in `\marg{coor \vspace*{0.3cm} \noindent -The default choice for tick \emph{positions} in normal plots is to place a tick at each coordinate~$i\cdot h$. The step size~$h$ depends on the axis scaling and the axis limits. It is chosen from a list a ``feasible'' step sizes such that neither too much nor too few ticks will be generated. The default for logplots is to place ticks at positions $10^i$ in the axis' range. The positions depend on the axis scaling and the dimensions of the picture. If log plots contain just one (or two) positions $10^i$ in their limits, ticks will be placed at positions $10^{i\cdot h}$ with ``feasible'' step sizes $h$ as in the case of linear axis. +The default choice for tick \emph{positions} in normal plots is to place a tick at each coordinate~$i\cdot h$. The step size~$h$ depends on the axis scaling and the axis limits. It is chosen from a list of ``feasible'' step sizes such that neither too much nor too few ticks will be generated. The default for logplots is to place ticks at positions $10^i$ in the axis' range. The positions depend on the axis scaling and the dimensions of the picture. If log plots contain just one (or two) positions $10^i$ in their limits, ticks will be placed at positions $10^{i\cdot h}$ with ``feasible'' step sizes $h$ as in the case of linear axis. \noindent -The tick \emph{appearance} can be (re-)configured with +The tick \emph{appearance} can be (re)configured with \begin{codeexample}[code only] \pgfplotsset{tick style={very thin,gray}}% modifies the style `every tick' \pgfplotsset{minor tick style={black}} % modifies the style `every minor tick' @@ -117,6 +117,23 @@ These style commands can be used at any time. The tick line width can be configu \end{pgfplotsxykeylist} +\begin{pgfplotsxykeylist}{minor \x tick=\marg{position list} (initially empty),minor tick=\marg{position list}} + Allows to provide a list of minor tick positions manually. The syntax is exactly the same as for |xtick| or |ytick|: simply provide a comma--separated list of tick positions. + + In contrast to |minor x tick num|, this key allows to provide \emph{non--uniform} minor tick positions. + +\begin{codeexample}[] +\begin{tikzpicture} + \begin{axis}[minor xtick={-3,1},grid=minor] + \addplot {x^3}; + \addplot {-20*x}; + \end{axis} +\end{tikzpicture} +\end{codeexample} + + This key has precedence over |minor x tick num| and its variants; if both of them are given, |minor xtick| is preferred and |minor x tick num| is ignored. +\end{pgfplotsxykeylist} + \begin{pgfplotsxykey}{extra \x\ ticks=\marg{coordinate list}} Adds \emph{additional} tick positions and tick labels to the $x$~or~$y$ axis. `Additional' tick positions do not affect the normal tick placement algorithms, they are drawn after the normal ticks. This has two benefits: first, you can add single, important tick positions without disabling the default tick label generation and second, you can draw tick labels `on top' of others, possibly using different style flags. @@ -221,11 +238,11 @@ Assigns a \emph{list} of tick \emph{labels} to each tick position. Tick \emph{po This is one of two options to assign tick labels directly. The other option is |xticklabel=|\marg{command} (or |yticklabel=|\marg{command}). The option `|xticklabel|' offers higher flexibility while `|xticklabels|' is easier to use. See also the variant |xticklabels from table|. -The argument \marg{label list} has the same format as for ticks, that means +The argument \meta{label list} has the same format as for ticks, that means \begin{codeexample}[code only] xticklabels={$\frac{1}{2}$,$e$} \end{codeexample} -Denotes the two--element--list $\{\frac 12, e\}$. The list indices match the indices of the tick positions. If you need commas inside of list elements, use +denotes the two--element--list $\{\frac 12, e\}$. The list indices match the indices of the tick positions. If you need commas inside of list elements, use \begin{codeexample}[code only] xticklabels={{0,5}, $e$}. \end{codeexample} @@ -275,6 +292,8 @@ coordinates { \end{codeexample} Note that it is also possible to terminate list entries with two backslashes, |\\|. In that case, the last entry needs to be terminated by |\\| as well (it is the same alternative syntax which is also accepted for |\legend| and |cycle list|). + + Please keep in mind that the arguments \emph{always} refer the a list of tick positions, although it does not alter or define the list of positions. Consequently, you should also provide the list of positions. Note that a list of positions might be longer than what is actually displayed (in case the axis limits clip some of the value away), but the index mapping into \meta{label list} still includes the clipped values. \end{pgfplotsxykey} @@ -283,11 +302,11 @@ These keys change the \TeX-command which creates the tick \emph{labels} assigned This is one of the two options to assign tick labels directly. The other option is `|xticklabels=|\marg{label list}' (or |yticklabels=|\marg{label list}). The option `|xticklabel|' offers higher flexibility while `|xticklabels|' is easier to use. -The argument \marg{command} can be any \TeX-text. The following commands are valid inside of \marg{command}: +The argument \meta{command} can be any \TeX-text. The following commands are valid inside of \meta{command}: \begin{description} \item[] \declareandlabel{\tick} The current element of option |xtick| (or |ytick|). \item[] \declareandlabel{\ticknum} The current tick number, starting with~0 (it is a macro containing a number). - \item[] \declareandlabel{\nexttick} This command is only valid in case if the |x tick label as interval| option is set (or the corresponding variable for~$y$). It will contain the position of the next tick position, that means the right boundary of the tick interval. + \item[] \declareandlabel{\nexttick} This command is only valid if the |x tick label as interval| option is set (or the corresponding variable for~$y$). It will contain the position of the next tick position, that means the right boundary of the tick interval. \end{description} The default argument is \begin{itemize} @@ -304,7 +323,7 @@ The default argument is } \end{codeexample} \end{itemize} -That means you can configure the appearance of linear axis with the number formatting options described in section~\ref{sec:number:printing} and logarithmic axis with |log number format code|, see below. +That means you can configure the appearance of linear axis with the number formatting options described in Section~\ref{sec:number:printing} and logarithmic axis with |log number format code|, see below. \begin{codeexample}[] \begin{tikzpicture} @@ -454,7 +473,7 @@ There is also the style ``|every tick|'' which applies to both, major and minor \end{pgfplotsxykeylist} \begin{pgfplotsxykeylist}{\x tickmin=\marg{coord}, \x tickmax=\marg{coord}} - These keys can be used to modify minimum/maximum values before ticks are drawn. Because this applies to axis discontinuities, it is described on page~\pageref{key:xytickminmax} under section~\ref{key:xytickminmax}, ``Axis Discontinuities"'. + These keys can be used to modify minimum/maximum values before ticks are drawn. Because this applies to axis discontinuities, it is described on page~\pageref{key:xytickminmax} in Section~\ref{key:xytickminmax}, ``Axis Discontinuities"'. \end{pgfplotsxykeylist} \subsubsection{Tick Alignment: Positions and Shifts} @@ -466,7 +485,7 @@ For $x$, the additional choices |bottom| and |top| can be used which are equival Changing |tick pos| will also affect the placement of tick labels. -Note that it can also affect |axis lines| key although not all combinations make sense. Make sure the settings are consistent. +Note that it can also affect the |axis lines| key, although not all combinations make sense. Make sure the settings are consistent. \end{pgfplotsxykeylist} \begin{pgfplotsxykeylist}{% @@ -535,7 +554,7 @@ These tick alignment options are set automatically by the |axis x line| and |axi \begin{pgfplotsxykeylist}{% \x ticklabel shift=\marg{dimension} (initially empty),% ticklabel shift=\marg{dimension} (initially empty)} - Shifts tick labels in direction of the outer unit normal of the axis by an amount of \marg{dimension}. The |ticklabel shift| sets the same value for all axes. + Shifts tick labels in direction of the outer unit normal of the axis by an amount of \meta{dimension}. The |ticklabel shift| sets the same value for all axes. This is usually unnecessary as the |anchor| of a tick label already yields enough spacing in most cases. \end{pgfplotsxykeylist} @@ -546,7 +565,7 @@ These tick alignment options are set automatically by the |axis x line| and |axi scaled ticks=\mchoice{true,false,base 10:{\normalfont\meta{e}},real:{\normalfont\meta{num}},manual:{\normalfont\marg{label}\marg{code}}} (initially true),% scaled \x\ ticks=\meta{one of the values} (initially true)% } -Allows to factor out common exponents in tick labels for \emph{linear axes}. For example, if you have tick labels $20000,40000$ and $60000$, you may want to save some space and write $2,4,6$ with a separate factor `$\cdot 10^4$'. Use `|scaled ticks=true|' to enable this feature. In case |true|, tick scaling will be triggered if the data range is either too large or too small (see below). +Allows to factor out common exponents in tick labels for \emph{linear axes}. For example, if you have tick labels $20000,40000$ and $60000$, you may want to save some space and write $2,4,6$ with a separate factor `$\cdot 10^4$'. Use `|scaled ticks=true|' to enable this feature. In case of |true|, tick scaling will be triggered if the data range is either too large or too small (see below). \begin{codeexample}[] \begin{tikzpicture} \begin{axis}[scaled ticks=true] @@ -623,14 +642,13 @@ A further -- not very useful -- example is shown below. Every $x$ tick label has Unfortunately, \meta{num} can't be evaluated with \PGF's math parser (yet) to maintain the full data range accepted by \PGFPlots. - The last option, |scaled ticks=manual:|\marg{label}\marg{code} allows even more customization. It allows \emph{full control} over the displayed scaling label \emph{and} the scaling code: \marg{text} is used as-is inside of the tick scaling label while \marg{code} is supposed to be a one-argument-macro which scales each tick. Example: + The last option, |scaled ticks=manual:|\marg{label}\marg{code} allows even more customization. It allows \emph{full control} over the displayed scaling label \emph{and} the scaling code: \meta{label} is used as-is inside of the tick scaling label while \meta{code} is supposed to be a one-argument-macro which scales each tick. Example: \begin{codeexample}[] \begin{tikzpicture} \begin{axis}[ % warning: the '%' signs are necessary (?) scaled y ticks=manual:{$+65\,535$}{% - \pgfmathfloatcreate{1}{6.5535}{4}% - \pgfmathfloatsubtract{#1}{\pgfmathresult}% + \pgfmathparse{#1-65535}% }, yticklabel style={ /pgf/number format/fixed, @@ -648,11 +666,11 @@ A further -- not very useful -- example is shown below. Every $x$ tick label has \end{codeexample} \noindent The example uses |$+65\,535$| as tick scale label content. Furthermore, it defines the customized tick label formula $y - (+6.5535\cdot 10^4) = y - 65535$ to generate $y$ tick labels. -The \marg{text} can be arbitrary. It is completely in user control. The second argument, \marg{code} is supposed to be a one-argument-macro in which |#1| is the current tick position in floating point representation. The macro is expected to assign |\pgfmathresult| (also in floating point representation). The \PGF\ manual~\cite{tikz} contains detailed documentation about its math engine (including floating point\footnote{However, that particular stuff is newer than \PGF\ $2.00$. At the time of this writing, it is only available as (public) CVS version.}). +The \meta{label} can be arbitrary. It is completely in user control. The second argument, \meta{code} is supposed to be a one-argument-macro in which |#1| is the current tick position in floating point representation. The macro is expected to assign |\pgfmathresult| (as a number). The \PGF\ manual~\cite{tikz} contains detailed documentation about its math engine. This feature may also be used do transform coordinates in case they can't be processed with \PGFPlots: transform them and supply a proper tick scaling method such that tick labels represent the original range. -If \marg{text} is empty, the tick scale label won't be drawn (and no space will be occupied). +If \meta{label} is empty, the tick scale label won't be drawn (and no space will be occupied). Tick scaling does \emph{not} work for logarithmic axes. \end{pgfplotsxykeylist} @@ -711,30 +729,30 @@ If the code is empty, no tick scale label will be drawn (and no space is consume \end{codeexample} \end{pgfplotskey} -\begin{pgfplotskey}{scale ticks below=\marg{exponent}} -Allows fine tuning of the `|scaled ticks|' algorithm: if the axis limits are of magnitude $10^e$ and $e<$\marg{exponent}, the common prefactor~$10^e$ will be factored out. The default is \makeatletter -\pgfplots@scale@ticks@below@exponent -\makeatother. +\let\itsinitial=\pgfplots@scale@ticks@below@exponent +\makeatother +\begin{pgfplotskey}{scale ticks below=\marg{exponent} (initially \itsinitial)} +Allows fine tuning of the `|scaled ticks|' algorithm: if the axis limits are of magnitude $10^e$ and $e<$\meta{exponent}, the common prefactor~$10^e$ will be factored out. The default is \end{pgfplotskey} -\begin{pgfplotskey}{scale ticks above=\marg{exponent}} -Allows fine tuning of the '|scaled ticks|' algorithm: if the axis limits are of magnitude $10^e$ and $e>$\marg{exponent}, the common prefactor~$10^e$ will be factored out. The default is \makeatletter -\pgfplots@scale@ticks@above@exponent -\makeatother. +\let\itsinitial=\pgfplots@scale@ticks@above@exponent +\makeatother +\begin{pgfplotskey}{scale ticks above=\marg{exponent} (initially \itsinitial)} +Allows fine tuning of the '|scaled ticks|' algorithm: if the axis limits are of magnitude $10^e$ and $e>$\meta{exponent}, the common prefactor~$10^e$ will be factored out. \end{pgfplotskey} -\subsubsection{Tick Fine Tuning} +\subsubsection{Tick Fine-Tuning} The tick placement algorithm depends on a number of parameters which can be tuned to get better results. -\begin{pgfplotskey}{max space between ticks=\marg{number} (initially 35)} +\begin{pgfplotskey}{max space between ticks=\marg{number} (initially \axisdefaulttickwidth)} \label{maxspacebetweenticks} - Configures the maximum space between adjacent ticks in full points. The suffix ``|pt|'' has to be omitted and fractional numbers are not supported. The default is~\axisdefaulttickwidth. + Configures the maximum space between adjacent ticks in full points. The suffix ``|pt|'' has to be omitted and fractional numbers are not supported. \end{pgfplotskey} -\begin{pgfplotskey}{try min ticks=\marg{number} (initially 3)} - Configures a loose lower bound on the number of ticks. It should be considered as a suggestion, not a tight limit. The default is~\axisdefaulttryminticks. This number will increase the number of ticks if `|max space between ticks|' produces too few of them. +\begin{pgfplotskey}{try min ticks=\marg{number} (initially \axisdefaulttryminticks)} + Configures a loose lower bound on the number of ticks. It should be considered as a suggestion, not a tight limit. This number will increase the number of ticks if `|max space between ticks|' produces too few of them. The total number of ticks may still vary because not all fractional numbers in the axis' range are valid tick positions. \end{pgfplotskey} @@ -744,11 +762,11 @@ The tick placement algorithm depends on a number of parameters which can be tune \end{pgfplotskey} \begin{pgfplotskeylist}{tickwidth=\marg{dimension} (initially 0.15cm),major tick length=\marg{dimension} (initially 0.15cm)} - Sets the width of major tick lines. + Sets the length of major tick lines. \end{pgfplotskeylist} \begin{pgfplotskeylist}{subtickwidth=\marg{dimension} (initially 0.1cm),minor tick length=\marg{dimension} (initially 0.1cm)} - Sets the width of minor tick lines. + Sets the length of minor tick lines. \end{pgfplotskeylist} \begin{pgfplotsxykeylist}{\x tick placement tolerance (initially 0.05pt)} |