Menu ▾ ▴

#86 Manual error for xticklabel pos

v1.0 (example)
closed-fixed
nobody
None
1
2015-05-25
2015-05-24
Torbjorn
No

There seems to be a small discrepancy in the manual. For xticklabel pos it reads

/pgfplots/xticklabel pos=left|right|default         (initially default)
/pgfplots/yticklabel pos=left|right|default         (initially default)
/pgfplots/zticklabel pos=left|right|default          (initially default)
/pgfplots/ticklabel pos=left|right|default           (initially  default)

Allows to choose where to place tick labels. The choices left and right place tick labels either at the left or at the right side of the complete axis. The choice default uses the same setting as xtick pos (or ytick pos). This option is only useful for boxed axes – keep it to default for non-boxed figures. The ticklabel pos style sets all three of them to the same value.

For x, the additional choices bottom and top can be used which are equivalent to left and right, respectively. Both are accepted for x.

However, compiling this code:

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
  axis x line=middle,
  xticklabel pos=top,
]
\addplot[samples=2] {x};
\end{axis}
\end{tikzpicture}
\end{document}

throws the error

! Package pgfplots Error: Sorry, the key 'xticklabel pos' does not know what to
  do with 'top'... accepted values are 'default, 'lower', 'upper' and some
  aliases. Maybe you misspelled it?.

The error is pretty clear about what is allowed, but it is not the same as given in the manual.

Discussion

  • Christian Feuersänger

    Thanks for bringing this to my attention!

    I have added support for "xticklabel pos=bottom|top".

     
  • Christian Feuersänger

    • status: open --> closed-fixed