topnush
I have the following code:


\documentclass[xcolor={rgb}]{beamer}

\setbeamersize{text margin left=10mm,text margin right=5mm}
\setbeamertemplate{frametitle}[default][center]
\usepackage{tikz}

\newcommand{\tikzcircle}[3][red]{\tikz[baseline=-0.5ex]{\node[draw={blue}, fill={#1}, circle,text width=#2,minimum width=0em,text=black,align=center] at (0,0) {#3};}\hspace{0pt}}%

\def\numcolors{4}
\pgfmathparse{1/\numcolors}%
\definecolorseries{foo}{hsb}{step}{red!90!black}{\pgfmathresult,0,0}
\resetcolorseries[\numcolors]{foo}%
\pgfmathsetseed{2}

\usepackage{booktabs}

\begin{document}
\begin{frame}{Example}
\hspace*{-0.5cm}\foreach \x in {1,2,1,4,1,2,3,1,1,2,3,4}{%
\tikzcircle[{foo!![\x]}]{1pt}{}%
}%

\vskip 2cm
\hspace{1cm}
\begin{tikzpicture}
\draw[xstep=1.8cm, ystep=0.8cm, color=gray] (0,0) grid (5.4,1.6);
\pause
\visible<+->{
\node at (0.2, +1.3) {-}; %yellow
\node at (3.8, +0.5) {-};
}
\visible<+->{
\node at (3.8, +1.3) {+}; %light blue
\node at (3.8, +0.2) {-};
}
\visible<+->{
\node at (0.2, +1.0) {-}; %yellow
\node at (4.1, +0.5) {-};
}

\visible<+->{
\node at (0.5, +1.3) {+}; %red
\node at (0.2, +0.5) {+};
}

\visible<+->{
\node at (0.5, +1.0) {-}; %yellow
\node at (4.1, +0.2) {-};
}

\visible<+->{
\node at (3.8, +1.0) {+}; %light blue
\node at (4.4, +0.5) {-};
}

\end{tikzpicture}
\hspace*{1cm}
\begin{tabular}{lll}
\toprule
& $h_1,g_1$ & $h_2, g_2$\\
\midrule
\tikzcircle[{foo!![1]}]{1pt}{} & $1,-$ & $3,-$\\
\tikzcircle[{foo!![2]}]{1pt}{} & $3,+$ & $3,-$\\
\tikzcircle[{foo!![3]}]{1pt}{} & $2,-$ & $2,+$\\
\tikzcircle[{foo!![4]}]{1pt}{} & $1,+$ & $1,+$\\
\bottomrule
\end{tabular}
\end{frame}
\end{document}


It is not fully complete but I would like to show each transition (addition of a pair of +/- symbols to the grid) by raising one of the circles up by half its radius.

So on the first transition when

\node at (0.2, +1.3) {-}; %yellow
\node at (3.8, +0.5) {-};

is drawn I would like the first circle to be raised. On the second when

\node at (3.8, +1.3) {+}; %light blue
\node at (3.8, +0.2) {-};

is drawn I would like the first circle to go back to its normal position and the second circle to be raised and so on.

As a side question, how can I move the table up so its bottom aligns with the bottom of the grid? I tried vskip and vspace with no luck.
marmot
I do not know if this goes in the right direction. However, raising circles on specific overlays can be achieved with something along the lines

\foreach \x [count=\y] in {1,...,\numdots}{%
\pgfmathtruncatemacro{\mycf}{{\cols}[\x-1]}%
\ifnum\y>1\relax\;\fi\alt<\y>{%
\raisebox{1ex}{\mycircle[\mycf]}}{%
\mycircle[\mycf]}%
}

Further, to sequentially add + and - signs, one can create a macro (called \UncoverList below) that takes a list and adds the items of the list one by one. I tried to add the lists to get something that resembles your results, but did not check carefully if this reproduces your results precisely.


\documentclass[xcolor={rgb}]{beamer}
\setbeamersize{text margin left=10mm,text margin right=5mm}
\setbeamertemplate{frametitle}[default][center]
\usepackage{circledsteps}
\usepackage{tikz}
\usetikzlibrary{matrix}
\newcommand{\mycircle}[1][1]{%
\Circled[fill color={foo!![#1]},outer color=blue!60]{\phantom{\mbox{o}}}}%
\def\numcolors{4}
\pgfmathparse{1/\numcolors}%
\definecolorseries{foo}{hsb}{step}{red!90!black}{\pgfmathresult,0,0}
\resetcolorseries[\numcolors]{foo}%
\makeatletter
\newcommand{\UncoverList}[2][]{\c@pgf@counta0\relax
\pgfutil@for\my@item:={#2}\do{%
\only<\c@pgf@counta->{\my@item}%
}}
\makeatother
\begin{document}
\begin{frame}
\frametitle{Using \texttt{circledsteps}}
\centering
\begin{tikzpicture}
\node (crow) {\def\numdots{8}%
\def\cols{1,2,3,4,1,2,3,4}
\foreach \x [count=\y] in {1,...,\numdots}{%
\pgfmathtruncatemacro{\mycf}{{\cols}[\x-1]}%
\ifnum\y>1\relax\;\fi\alt<\y>{%
\raisebox{1ex}{\mycircle[\mycf]}}{%
\mycircle[\mycf]}%
}%
};

\path ([yshift=-1cm,xshift=-1cm]crow.south)
[cond/.code={%
\ifnum\pgfmatrixcurrentcolumn=1\relax
\else
\tikzset{fill=blue!10,draw=white,text width=3.2em,align=left}%
\fi}]
node[below right,matrix of nodes,
ampersand replacement=\&,nodes in empty cells,
nodes={text height=1.6em,text depth=0.2ex,cond}
] (mat1) {%
$h_1$ \& $\begin{array}[b]{l} \scriptstyle\vphantom{1}\UncoverList{,-,-,,+}\\ \scriptstyle\vphantom{1}\end{array}$  \&  \&
$\begin{array}[b]{l} \scriptstyle\vphantom{1}\UncoverList{,,+}\\ \scriptstyle\vphantom{1}\UncoverList{,,,,,,+}\end{array}$\\
$h_2$ \& $\begin{array}[b]{l} \scriptstyle\vphantom{1}\UncoverList{,,,,+}\\ \scriptstyle\vphantom{1}\end{array}$ \&  \&
$\begin{array}[b]{l} \scriptstyle\vphantom{1}\UncoverList{,-,,-,,,+}\\ \scriptstyle\vphantom{1}\UncoverList{,,-,,,+}\end{array}$\\
};
\path ([xshift=0.8cm]mat1.south east)
[cond/.code={%
\ifnum\pgfmatrixcurrentrow=1\relax
\tikzset{fill=blue!50,text=white}%
\else
\ifodd\pgfmatrixcurrentrow
\tikzset{fill=blue!10}%
\else
\tikzset{fill=blue!20}%
\fi
\fi}]
node[above right,matrix of math nodes,
ampersand replacement=\&,nodes in empty cells,
cells={nodes={draw=white,minimum width=3em,
text height=0.8em,text depth=0.25ex,cond}}] (mat1) {%
\& h_1,g_1 \& h_2,g_2\\[0.2ex]
\mycircle[1] \& 2,+\& 1,+\\
\mycircle[2] \& 3,-\& 2,+\\
\mycircle[3] \& 1,+\& 3,-\\
\mycircle[4] \& 2,-\& 3,+\\
};
\end{tikzpicture}
\end{frame}
\end{document}

![ani.gif](/image?hash=b398883acb40b3c59aaf25117744f79547a0bb5572a7e96a628fc404b63694ad)

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.