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.tex40
1 files changed, 37 insertions, 3 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 a35ef1b049f..16162db494a 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex
@@ -176,7 +176,7 @@ coordinates
Here |xbar| yields |/pgfplots/xbar| because it is an argument to the axis, not to a single plot.
For bar plots, it is quite common to provide textual coordinates or even descriptive nodes near the bars.
- This can be realized using the |symbolix y coords| and |nodes near coords| keys, respectively:
+ This can be implemented using the keys |symbolic y coords| and |nodes near coords|, respectively:
\begin{codeexample}[]
\begin{tikzpicture}
\begin{axis}[
@@ -385,12 +385,46 @@ Here, |ybar| yields |/pgfplots/ybar| because it is an argument to the axis, not
\end{pgfplotskey}
-\begin{key}{/pgf/bar width=\marg{dimension} (initially 10pt)}
+\begin{key}{/pgf/bar width=\marg{dimension or unit} (initially 10pt)}
Configures the width used by |xbar| and |ybar|. It is accepted to provide mathematical expressions.
+
+ As of \PGFPlots\ 1.7, it is allows to provide an \emph{unit} as |bar width|. In this case, the |bar width| will be interpreted as axis unit:
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[
+ xbar=0pt,% space of 0pt between adjacent bars
+ bar width=2,
+ width=7cm,
+ height=12cm,
+ minor y tick num=4,
+ ytick=data,
+ enlargelimits=0.15]
+\addplot
+coordinates
+ {(10,5) (15,10) (5,15) (24,20) (30,25)};
+\addplot
+coordinates
+ {(3,5) (5,10) (15,15) (20,20) (35,25)};
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ In order to interprete arguments as units, you have to write |\pgfplotsset{compat=1.7}| (or newer) into your preamble. Older versions will implicitly append the |pt| suffix if the argument is no dimension.
+
+ \begin{command}{\pgfplotbarwidth}
+ A mathematical expression which results in the fully computed value of |bar width| (i.e.\ it includes any unit computations).
+ \end{command}
+
+ Note that you may need to |enlargelimits| in order to see the complete bar -- \PGFPlots\ will not automatically update the axis limits to respect |bar width|.
\end{key}
-\begin{key}{/pgf/bar shift=\marg{dimension} (initially 0pt)}
+\begin{key}{/pgf/bar shift=\marg{dimension or unit} (initially 0pt)}
Configures a shift for |xbar| and |ybar|. Use |bar shift| together with |bar width| to draw multiple bar plots into the same axis. It is accepted to provide mathematical expressions.
+
+ As of \PGFPlots\ 1.7, it is allows to provide an \emph{unit} as |bar shift|. In this case, the |bar shift| will be interpreted as axis unit.
+ \begin{command}{\pgfplotbarshift}
+ A mathematical expression which results in the fully computed value of |bar shift| (i.e.\ it includes any unit computations).
+ \end{command}
+ Note that you may need to |enlargelimits| in order to see the complete bar -- \PGFPlots\ will not automatically update the axis limits to respect |bar shift|.
\end{key}