# Comma alignment problem

I don't know how to set all the labels on the same level.

\documentclass[french]{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[>=stealth,x=6cm,font=\footnotesize]

\draw [->] (0,0)--(1,0)  ;

\foreach \x in {0,1,...,12} {%
\coordinate (\x) at (\x/12,0) ;
\draw [very thin] (\x/12,+2pt)--(\x/12,-2pt) ;

\pgfmathsetmacro\result{2 + \x / 10}
\node[above=1pt]  at (\x)%
{\pgfmathprintnumber[precision=1,fixed,use comma]{\result}};

} ;

\end{tikzpicture}
\end{document}


-

The problem is that the nodes with the comma are higher than those without, or specifically they have a larger depth, that is they go further below the baseline of the text. One way of fixing this is to set the text depth for the nodes:

\node[above=1pt,text depth=2pt]  at (\x)%
{\pgfmathprintnumber[precision=1,fixed,use comma]{\result}};


(For an illustration of text depth see the second screenshot in this answer of mine to another question.)

\documentclass[10pt,a4paper,french]{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[>=stealth,x=6cm,font=\footnotesize]

\draw [->] (0,0)--(1,0)  ;

\foreach \x in {0,1,...,12} {%
\coordinate (\x) at (\x/12,0) ;
\draw [very thin] (\x/12,+2pt)--(\x/12,-2pt) ;

\pgfmathsetmacro\result{2 + \x / 10}
\node[above=1pt,text depth=3pt]  at (\x)%
{\pgfmathprintnumber[precision=1,fixed,use comma]{\result}};

} ;

\end{tikzpicture}
\end{document}

-