1

When I don't use babel package, pins are ok. I suspect there is a problem with the colon, in french we put a space before and after, but how to tell pgfplot not to do it?

\documentclass{standalone}
\usepackage{pgfplots}
\usepackage[francais]{babel}
\begin{document}
\begin{tikzpicture}
    \begin{axis}
        \addplot[domain=0:1,samples=20,smooth,blue,thick](
        {(1-x)^2*1+2*(1-x)*x*5+x^2*10},
        {(1-x)^2*5+2*(1-x)*x*25+x^2*30}
        );
        \addplot[domain=0:1,samples=20,smooth,blue,thick]
        coordinates{(10,30) (20,40)};

        \addplot[red,very thin] coordinates{(0,0) (8,40)};
        \addplot[red,very thin] coordinates{(0,20) (10,30)};
        \node [coordinate, pin=-30:{$P_0$}] at (axis cs:1,5) {};
        \node [coordinate,pin={150:{$P_1$}}] at (axis cs:5,25) {};
        \node [coordinate,pin=-30:{$P_2$}] at (axis cs:10,30) {};
    \end{axis}
\end{tikzpicture}
\end{document}

enter image description here

Penbeuz
  • 1,669

1 Answers1

0

Thanks to Claudio Fiandrino

\documentclass{standalone}
\usepackage{pgfplots}
\usepackage[francais]{babel}
\begin{document}
\shorthandoff{:}
\pgfversion
\begin{tikzpicture}
    \begin{axis}
        \addplot[domain=0:1,samples=20,smooth,blue,thick](
        {(1-x)^2*1+2*(1-x)*x*5+x^2*10},
        {(1-x)^2*5+2*(1-x)*x*25+x^2*30}
        );
        \addplot[domain=0:1,samples=20,smooth,blue,thick]
        coordinates{(10,30) (20,40)};

        \addplot[red,very thin] coordinates{(0,0) (8,40)};
        \addplot[red,very thin] coordinates{(0,20) (10,30)};
        \node [coordinate, pin=-30:{$P_0$}] at (axis cs:1,5) {};
        \node [coordinate,pin={150:{$P_1$}}] at (axis cs:5,25) {};
        \node [coordinate,pin=-30:{$P_2$}] at (axis cs:10,30) {};
    \end{axis}
\end{tikzpicture}
\end{document}
Penbeuz
  • 1,669