tikzの\onslideコマンドはエラーも効果も発生しません

tikzの\onslideコマンドはエラーも効果も発生しません

私は tikz を使い始めたばかりで、初めて \onslide コマンドを使用しようとしました。私のコードがエラーを生成せず、効果も生成しない理由がわかりません (すべてのコンテンツを含む 3 つのスライドに 3 つの同一のプロットが生成されます)。

これが私の MWE です:

\documentclass[10pt]{beamer}
\usetheme{Madrid}

% Plot
\usepackage{tikz}
\usepackage{tkz-euclide}    % Coordinate axes
\usepackage{pgfplots}       % Another axes package
\pgfdeclarelayer{background}% determine background layer
\pgfsetlayers{background,main}% order of layers

\begin{document}

\begin{frame}{Sample}
\begin{figure}
    \centering
\pgfplotsset{xmin=0, xmax=1, ymin=0, ymax=1}    
\pgfplotsset{compat=1.17}
\begin{tikzpicture}[scale=1]
\begin{axis}[domain=0:1,
    ylabel near ticks,
    xlabel near ticks,
    xlabel={$m$},
    ylabel={$n$},
    clip mode=individual]
\addplot[black,dashed,domain=0:1,smooth]  plot ({\x}, {\x });
\addplot[black,thick,domain=0:1,smooth,samples=500]  plot ({ 3*\x/(3*\x + (1-\x)) }, {\x});
\node[anchor=south] at (0.75,0.55) {$\color{black}g_b$};
\onslide<2->{
\addplot[black,thick,domain=0:1,smooth,samples=500]  plot ({ 9*\x/(9*\x + (1-\x)) }, {\x});
\node[anchor=south] at (0.8,0.4) {$\color{black}g_b^2$}; }
\onslide<3->{
\addplot[black,thick,domain=0:1,smooth,samples=500]  plot ({ 81*\x/(81*\x + (1-\x)) }, {\x});
\node[anchor=south] at (0.9,0.2) {$\color{black}g_b^3$}; }
\end{axis}
\end{tikzpicture} 
\end{figure}

\end{frame}
\end{document}

答え1

まあ、私はこう変えようと思う

\only<overlay specification>{\addplot { ... };}

動作します。この問題に遭遇した他の人の助けになれば幸いです。

関連情報