# PGFPlots axis label not moving

Could some body please explain why I can't move the y axis label to the end of the axis like the x. Using the following I get the below.

\documentclass[a4paper]{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xscale = 1.5,
yscale = 1,
xmin = -5,
xmax = 5,
ymin = -pi / 2,
ymax = (pi / 2)*1.25,
xlabel={$x$},
ylabel={$y$},
axis lines = center,
samples = 1000,
ytick = {-1.5708,-0.7853,0.7853,1.5708},
yticklabels = {$-\frac{\pi}{2}$,$-\frac{\pi}{4}$,$\frac{\pi}{4}$, $\frac{\pi}{2}$},
grid style={ultra thin},
grid=major
],
\addplot[smooth,ultra thick] {rad(atan(x))} node[above left,pos=1] {$arctan \left( x \right)$};
\end{axis}
\end{tikzpicture}
\end{document}


I have tried several different things but nothing has any effect. One example I've tried is.

ylabel={$y$},
ylabel style={at=(current axis.above origin), anchor=south},

• Does it work using the most recent compatibility layer? \pgfplotsset{compat=1.13} – Benjamin May 2 '16 at 21:10
• @Benjamin You should answer as that works. It also shows the importance of reading the console output: the package tells you you should probably add this. – cfr May 2 '16 at 21:16
• Welcome! See comments above re. fix and re. console output, importance of. :-) – cfr May 2 '16 at 21:17
• @cfr Ok, if it works I will do that. Actually I was just guessing and didn't test it. – Benjamin May 2 '16 at 21:27
• @Benjamin I did, though ;). – cfr May 2 '16 at 21:36

Your MWE produces the following warning:

Package pgfplots Warning: running in backwards compatibility mode (unsuitable tick labels; missing features). Consider writing \pgfplotsset{compat=1.13} into your preamble.

If you are running into problems you should always have a look at the log file. So in your case adding

\pgfplotsset{compat=1.13}


solves the problem.

PS: It should be \arctan and not arctan as you probably don't mean the product of a, r, c, t, a and n.

• Cheers worked perfectly. So if i'm writing in backwards compatibility mode, what would be the new code to stop this problem? – jackjameshoward May 3 '16 at 7:41
• And thanks for the point on the \arctan, makes a surprising difference. – jackjameshoward May 3 '16 at 7:47
• You should not use the backwards compatibility mode unless it is absolutely necessary. Off the top of my head I don't know how to fix it there. – Benjamin May 3 '16 at 7:48