tikz-datavisualization 在幻灯片内部时不呈现数据

tikz-datavisualization 在幻灯片内部时不呈现数据

当在幻灯片内部时,数据不会被呈现。

有什么提示或解决方法吗?

在此处输入图片描述

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary {datavisualization.formats.functions}

\begin{document}

\begin{frame}[fragile]
  \frametitle{Foo}
  
    \onslide<1->{
      No data displayed:
      
    \tikz \datavisualization
  [scientific axes=clean,
   visualize as scatter/.list={a,b,c},
   style sheet=cross marks]
data [format=named] {
  x=0,       y={1,2,3},        set=a
  x={2,3,4}, y={3,4,5,7},      set=b
  x=6,       y={5,7,...,15},   set=c
};
    }

    
    Data displayed:
    
    \tikz \datavisualization
  [scientific axes=clean,
   visualize as scatter/.list={a,b,c},
   style sheet=cross marks]
data [format=named] {
  x=0,       y={1,2,3},        set=a
  x={2,3,4}, y={3,4,5,7},      set=b
  x=6,       y={5,7,...,15},   set=c
};


\end{frame}

\end{document}

答案1

uncoverenv您可以通过使用和onlyenv类似的环境来避免该问题:

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary {datavisualization.formats.functions}

\begin{document}

\begin{frame}[fragile]
  \frametitle{Foo}
  
\begin{uncoverenv}<1->
      No data displayed:
      
    \tikz \datavisualization
  [scientific axes=clean,
   visualize as scatter/.list={a,b,c},
   style sheet=cross marks]
data [format=named] {
  x=0,       y={1,2,3},        set=a
  x={2,3,4}, y={3,4,5,7},      set=b
  x=6,       y={5,7,...,15},   set=c
};
\end{uncoverenv}
    
    Data displayed:
    
    \tikz \datavisualization
  [scientific axes=clean,
   visualize as scatter/.list={a,b,c},
   style sheet=cross marks]
data [format=named] {
  x=0,       y={1,2,3},        set=a
  x={2,3,4}, y={3,4,5,7},      set=b
  x=6,       y={5,7,...,15},   set=c
};


\end{frame}

\end{document}

相关内容