\label 引用仅在使用 pgfplots 的环境中不起作用

\label 引用仅在使用 pgfplots 的环境中不起作用

我真的被以下问题难住了。我有一张有很多曲线的图像,因此,我想使用 \only 一步一步地绘制它们。我还有一个 \label 以便将其写在图例中。但当我回忆起它时,它不起作用。我从 beamer 文档中读到,only 中 \label 的正确定义是:

\仅{一些文本。\label{my_label}}

但是这样代码也不起作用,有什么建议吗?

\begin{frame}{Risultati, Correlazioni a un punto, Primo Ordine}
 \pause
\begin{columns}
\begin{column}{0.5\textwidth}
 Effetti numero di Richardson
     \begin{figure}
    \begin{tikzpicture}[scale=0.95]
    \begin{axis}[width=\columnwidth, xlabel={$y/R$}, ylabel={$\overline{U_z}$}]
            \only<3->{\addplot[color = black, line width=0.8 pt]
            table[x index = 6, y index = 3]{./data/RE_180/forced/profiles.txt};}
            \only<4->{\addplot[color = green, line width=0.8 pt]
            table[x index = 6, y index = 3]{./data/RE_180/ri17/profiles.txt};}
           \only<5->{\addplot[color = cyan, line width=0.8 pt]
            table[x index = 6, y index = 3]{./data/RE_180/ri40/profiles.txt};
            \addplot[color = blue, line width=0.8 pt]
            table[x index = 6, y index = 3]{./data/RE_180/ri87/profiles.txt};
            \addplot[color = red, line width=0.8 pt]
            table[x index = 6, y index = 3, ]{./data/RE_180/ri241/profiles.txt};}
            \only<6->{\addplot[color = black, mark= o, mark size = 2 pt, only marks , mark phase =1, mark repeat =3]
            table[x index = 0, y index = 1]{./data/RE_180/forced/profiles_el.txt};
            \addplot[color = green, mark=o, only marks, mark size = 2 pt, mark repeat =3]
                table[x index = 0, y index = 1]{./data/RE_180/ri17/ri17.txt};
            \addplot[color = cyan, mark=o, only marks, mark size = 2 pt, mark repeat =3]
                table[x index = 0, y index = 1]{./data/RE_180/ri40/ri40.txt};
            \addplot[color = blue, mark=o, only marks, mark size = 2 pt, mark repeat =3]
                table[x index = 0, y index = 1]{./data/RE_180/ri87/ri87.txt};
            \addplot[color = red, mark=o, only marks, mark size = 2 pt, mark repeat =3]
                table[x index = 0, y index = 1]{./data/RE_180/ri241/ri241.txt};}
        \end{axis}
\end{tikzpicture}
\end{figure}
\end{column}

\begin{column}{0.5\textwidth}
\only<7->{Effetti numero di Reynolds
\begin{figure}
\begin{tikzpicture}[scale=0.95]
\begin{axis}[width=\columnwidth, xlabel={$y/R$}, ylabel={$\overline{U_z}$}]
            \only<8->{\addplot[color = black, line width=0.8 pt]
            table[x index = 6, y index = 3]{./data/RE_180/forced/profiles.txt};
            \addplot[color = green, line width=0.8 pt]
            table[x index = 6, y index = 3]{./data/RE_180/ri17/profiles.txt};
            \addplot[color = cyan, line width=0.8 pt]
            table[x index = 6, y index = 3]{./data/RE_180/ri40/profiles.txt};
            \addplot[color = blue, line width=0.8 pt]
            table[x index = 6, y index = 3]{./data/RE_180/ri87/profiles.txt};
            \addplot[color = red, line width=0.8 pt]
            table[x index = 6, y index = 3, ]{./data/RE_180/ri241/profiles.txt};}
            \only<9>{\addplot[color = black, line width=0.8 pt, dashed]
            table[x index = 6, y index = 3]{./data/RE_360/forced/profiles.txt};\label{black_d}        
        \addplot[color = green, line width=0.8 pt,dashed]
            table[x index = 6, y index = 3]{./data/RE_360/ri17/profiles.txt}; 
        \addplot[color = cyan, line width=0.8 pt,dashed]
            table[x index = 6, y index = 3]{./data/RE_270/ri40/profiles.txt};
        \addplot[color = black, line width=0.8 pt, dashed]
            table[x index = 6, y index = 3]{./data/RE_360/ri87/profiles.txt};
        \addplot[color = red, line width=0.8 pt,dashed]
            table[x index = 6, y index = 3]{./data/RE_360/ri241/profiles.txt};}
\end{axis}
\end{tikzpicture}
\end{figure}
}
\end{column}
\end{columns}
 \only<2->{Profilo di velocità assiale medio.} \only<3->{Ri 0 (\ref{Forced}),} \only<4->{Ri 0.017 (\ref{ri17}),} \only<5->{Ri 0.040 (\ref{ri40}), Ri 0.087 (\ref{ri87}), Ri 0.241 (\ref{ri241}),} \only<6->{$Re_\tau \; 180$ (\ref{Forced}), DNS di riferimento ($\circ$),} \only<9>{$Re_\tau \; 360$ (\ref{black_d}).}
\end{frame}

\ref{black_d} 未根据程序定义,我不明白为什么。不幸的是,我无法上传数据。但我得到的结果显示在图像中。如图所示,Re_\tau 360 的参考为未知。 在此处输入图片描述

相关内容