我需要在 beamer 中创建一个叠加图,因此我使用了“overlay-beamer-styles”库。然而,我的最小工作示例结果非常出乎意料:
罪魁祸首是以下代码:
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usetikzlibrary{overlay-beamer-styles}
\begin{document}
\begin{frame}
\begin{figure}
\begin{tikzpicture}
\begin{axis}[
xlabel={$\Pr(\theta=1)$},
ylabel={$U$},
xmin=-0.1, xmax=1.1,
ymax=1.4,
axis lines=middle,
samples=100,
height=0.8\textwidth,
width =0.7\textwidth,
xtick=\empty,
ytick=\empty,
xlabel style={anchor=west},
ylabel style={anchor=east},
clip=false,
]
\visible<1->{
\node[left] at (0,1) {$r_{00}$};
\node[left] at (0,0.05) {$r_{10}$};
\node[right] at (1,1) {$r_{11}$};
\node[right] at (1,0.04) {$r_{01}$};}
\addplot+[visible on=<2->, domain=0:1] {x};
\addplot+[visible on=<2->, domain=0:1] {1 - x};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{frame}
我想知道发生了什么事。非常感谢!