I want to place the xlabel for a plot on the same baseline the xticklabels. To do that I changed the xlabel style/at key to (ticklabel cs: 1), the rightmost position of the ticklabel coordinate system. However, the label is not on the same baseline, but has a y-offset compared to the tick labels. Note that, I applied an x-shift, to overlay the character 'm' with the tick-label '1' so that the offset can be easily seen.
Code:
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel = {m},
xlabel style = {
at = { (ticklabel cs: 1) },
anchor = south,
xshift = -15pt,
%yshift = -0.2pt,
},
]
\addplot coordinates { (0,1) (1,0) };
\end{axis}
\end{tikzpicture}
\end{document}
Since I can only post two links, I won't show an picture of the compiled pdf. Instead I will show zoomed in pictures of the axis label overlaid on the tick label. You can easily see there is an offset between the baseline of the tick label and the axis label:
If I apply a y-offset manually via the x label style (commented-out shift in the MWE), I can align the baselines of the tick labels and the axis label:
However, the required y-shift changes with the selected font and various other plot settings. How can I reliably vertically align the axis label with the tick labels?
Thank you in advance for your time and suggestions.