# PGFplots axis label style not working when axis lines=center in axis environment options

When compiling the code

\documentclass{standalone}
\begin{document}
\begin{tikzpicture}
\begin{axis}
[
x label style={rotate=45},
xlabel=$x$,
y label style={rotate=45},
ylabel=$y$,
z label style={rotate=45,at={(0,0.5)}},
zlabel=$z$,
axis lines=center,
view={45}{20}
]
\end{axis}
\end{tikzpicture}
\end{document}


the axis label style in the axis environment options do not seem to work.

The resulting picture looks like

Here you can see that although rotate=45 is set for each of the labels, they're not in the picture. Also the at={(0,0.5)} in z label style does not seem to work. But if I remove the command axis lines=center everything works fine.

How do I get these options to also work when using axis lines=center?

• axis lines=center also sets x label style, so it overwrites the options you set in x label style. Move axis lines=center to the start of your options list, and it will work as expected – Jake Mar 23 '15 at 17:12
• @Jake Indeed, works like a charm. Do you want to make an answer out of it or should I do it for you? – Adriaan Mar 23 '15 at 22:03
• The close vote because this is "unclear" seems misguided given that Jake has answered the question in the comments. – Andrew Apr 14 '15 at 12:48

Like Jake states in the comments, axis lines center also sets x label style, so it overwrites the options you set in x label style. Moving axis lines=center to the start of the options list solves the problem:

\documentclass{standalone}
\begin{document}
\begin{tikzpicture}
\begin{axis}
[
axis lines=center, % NOW AT THE TOP INSTEAD OF AT THE BOTTOM OF THE OPTIONS LIST.
x label style={rotate=45},
xlabel=$x$,
y label style={rotate=45},
ylabel=$y$,
z label style={rotate=45,at={(0,0.5)}},
zlabel=$z$,
view={45}{20}
]