I'm showing slides where I show a time evolution by going through snapshots. Each snapshot corresponds to a specific time.
I'd like to show a time arrow (vertically on the side) with bullets corresponding to each of the time points (unequally spaced). On each overlay, one of these bullets is solid filled and the current time is specified, whereas the other bullets are open (empty circles).
I think I can do the unaminated version quite easily with tikz, but I am not sure how to adjust the style of elements and presence of node text depending on overlay number.
Here's a MWE for a static timearrow:
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
\def\axscale{-0.02}
\def\thex{0}
\def\they{0}
\def\prevy{0}
\def\times{{-5,2, 12, 22, 32, 44, 76, 116, 182, 300,307}}
\def\maxt{9}
\foreach \it in {1,...,\maxt} {
\pgfmathparse{\axscale*\times[\it-1]}
\pgfmathsetmacro{\prevy}{\pgfmathresult}
\pgfmathparse{\axscale*\times[\it]}
\pgfmathsetmacro{\they}{\pgfmathresult}
\draw[-{Circle[open]}] (\thex,\prevy) -- (\thex,\they);
\node[right,anchor=west] at (\thex,\they) {
$t=\pgfmathparse{\times[\it]}
\pgfmathprintnumber[ % Print the result
fixed,
fixed zerofill,
precision=0,
assume math mode=true
]{\pgfmathresult}
$};
}
\pgfmathparse{\axscale*\times[\maxt]}
\pgfmathsetmacro{\prevy}{\pgfmathresult}
\pgfmathparse{\axscale*\times[\maxt+1]}
\pgfmathsetmacro{\they}{\pgfmathresult}
\draw[->] (\thex,\prevy) -- (\thex,\they);
%\draw(\thex,\prevy) -- (\thex+5,\they);
\end{tikzpicture}
\end{document}
So the elements to animate are Circle[open] and whether to display the t=... label.



\pgfmathsetmacro\mymacro{<my formula>}.\pgfmathsetmacrois also doing\pgfmathparseand stores the result in\mymacro. – Qrrbrbirlbel Mar 03 '23 at 19:33