# Uncover points of scatterplot

have a a plot that is similar to this (almost) minimal example here:

\documentclass{beamer}

\usepackage{pgfplots}
\pgfplotsset{compat=1.18}

\begin{document}
\begin{frame}
\begin{tikzpicture}
\begin{axis}[
axis x line = bottom,
axis y line = left,
]

samples at = {1.3, 2, 2.55, 3.5, 5.7, 12},
samples y =0,
point meta=(x-0.5)^2 + y^2,
mark = *,
only marks,
scatter,
]
({sin(x)}, {cos(x)}, {1/x});
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}


Is it possible to uncover the single samples one at a time with beamer overlays?

You can use the overlay-beamer-styles library:

\documentclass{beamer}

\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usetikzlibrary{overlay-beamer-styles}

\begin{document}
\begin{frame}
\begin{tikzpicture}
\begin{axis}[
axis x line = bottom,
axis y line = left,
]

samples at = {1.3, 2, 2.55, 3.5, 5.7,12},
samples y =0,
point meta=(x-0.5)^2 + y^2,
mark = *,
only marks,
scatter,
scatter src=z,
scatter/use mapped color={draw=mapped
color!80!black,fill=mapped color,visible on=<+->}
]
({sin(x)}, {cos(x)}, {1/x});
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}


• Haha. You gave the hint with overlay-beamer-styles just two days ago in another post of mine. I didn't see how I could use it here. Ty. Aug 7 at 11:42
• @Franz You're welcome! Aug 7 at 11:43
• Where can I actually find the documentation for tikz libraries? I tried to search for "CTAN overlay-beamer-styles" but did not find anything useful. The tikz/pgfplots documentation also does not mention it. Aug 7 at 19:16
• @Franz ctan.org/pkg/aobs-tikz Aug 7 at 19:18
• Ok. The name was so obscure that I didn't recognized it as overlay-beamer-styles. The documentation and the features also seem kind of sparse, e.g., I was looking for an alert on= command but could find it. Aug 8 at 0:07

A version not using any library, just adding \pause via scatter/@post marker code:

\documentclass{beamer}

\usepackage{pgfplots}
\pgfplotsset{compat=1.18}

\begin{document}
\begin{frame}
\begin{tikzpicture}
\begin{axis}[
axis x line = bottom,
axis y line = left,
scatter/@pre marker code/.code={},
scatter/@post marker code/.code={\pause}
]

samples at = {1.3, 2, 2.55, 3.5, 5.7, 12},
samples y =0,
point meta=(x-0.5)^2 + y^2,
mark =*,
only marks,
scatter,
]
({sin(x)}, {cos(x)}, {1/x});
\end{axis}

• You are a mighty magician, you can make footlines disappear :) Try e.g. with \usetheme{Boadilla} Aug 7 at 13:34
• @samcarter_is_at_topanswers.xyz I was just happy to get the \pause injected. (Is this salvageable, or should I delete?) Aug 7 at 13:53
• I know the feeling :) You can add a \onslide<1-> before the end of the tikzpicture. Aug 7 at 13:55