0

I currently have an issue aligning ticklabels when using a comma as decimal separator. For x ticklabels the alignment works fine and no modification is required. However, for y ticklabels, I can't figure the right way to overcome the alignment problem. I tried nodes={depth=somelength} as in Pgfplots: legend depth but it does not seem to work, seemingly due to the rotate=90 option.

Here is a MWE.

\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[%
width=7cm,
height=4cm,
/pgf/number format/use comma,
yticklabel style={nodes={text depth=100pt,anchor=north},rotate=90},
xticklabel style={nodes={text depth=100pt,anchor=north},rotate=0},
]
\addplot+[domain=0:1,samples=10] {x};
\addplot+[domain=0:1,samples=10] {x^2};
\end{axis}
\end{tikzpicture}%
\end{document}
BambOo
  • 8,801
  • 2
  • 20
  • 47

1 Answers1

1

enter image description here

Your syntax for y tick style is wrong ... for x ticks is default style OK.

\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}

\begin{document}
\begin{tikzpicture}
\begin{axis}[%
width=7cm,
height=4cm,
/pgf/number format/use comma,
yticklabel style={text depth=0.25ex,anchor=south,rotate=90},
]
\addplot+[domain=0:1,samples=10] {x};
\addplot+[domain=0:1,samples=10] {x^2};
\end{axis}
\end{tikzpicture}%
\end{document}
Zarko
  • 296,517