Pgfplots,pin 和 [francais]{babel} 的问题

Pgfplots,pin 和 [francais]{babel} 的问题

当我不使用 babel 包时,图钉没问题。我怀疑 有问题colon,在法语中我们在 前后都加了一个空格,但如何告诉 pgfplot 不要这样做呢?

\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}

在此处输入图片描述

答案1

感谢 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}

相关内容