I have this problem. When I am using the library overlay-beamer-styles with spy and opacity, spy doesn't work well.
The problem starts when I use visible on=<>
with two different \spy
and introduce opacity
to the image. This is the code:
\documentclass[compress]{beamer}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{calc, spy, overlay-beamer-styles, backgrounds}
\begin{document}
\begin{frame}
\centering
\begin{tikzpicture}[spy using overlays,
spy using outlines={circle,
size=1cm,
connect spies}
]
\pgfmathsetseed{10}
\newcommand{\Xa}{1.75}
\newcommand{\Ya}{2}
\newcommand{\Ca}{.9}
\node (a) at (\Xa,\Ya) {};
\foreach \p in {1,...,100}{
\pgfmathsetmacro{\xx}{\Ca*rand}
\coordinate (pta) at (1.5*\xx+\Xa,{rand*sqrt(\Ca^2-(\xx)^2)+\Ya});
\fill[opacity=.2, visible on=<1>] (pta) circle (0.04);
}
\spy[magnification=1.5, visible on=<1>] on (a) in node at (2.5,5);
\spy[magnification=2.5, visible on=<2>] on (1.5,1.5) in node at (2.5,5);
\end{tikzpicture}
\end{frame}
\end{document}
Even if there are no points, the second \spy
overlays taking only opacity
of \fill
. I have another example:
Some parts of the second \spy
are shown with opacity
in the previous \spy
.