Figure

Bonjour j'essaye de dessiner la figure suivante mais je n'ai pas obtenu le résultat que je voulais alors je veux que dans le dernier clic colorer les états en bleu et un état en rouge. Je fais ça
\uncover<2-19>{\foreach \i/\j in {-3/0,-3/1,-3/2,-2/2,-1/2,0/2} {\node[draw,circle,fill=cyan!9](\i_\j) at (\i,2-\j) {$\j$};}}
\uncover<-20>{\foreach \i/\j in {0/2} {\node[draw,circle,fill=red!9](\i_\j) at (\i,2-\j) {$\j$};}}
Mais ces états ne s'afftche pas dans le premier il s'affiche seulement à la fin (je sais est-ce que l'idée est claire ou non ?)
\begin{figure}[!h]
\begin{center}
\begin{tikzpicture}[x=1.5cm,>=latex]
\draw [->] (-4.5,-1)--(.5,-1);
\foreach \i in {-3,...,0} {
  \draw (\i,-.9)--(\i,-1.1) node[below] {\i};
}
\uncover<2->{\foreach \i/\j in {0/1,-1/0,0/0,-1/1,0/2,-1/2} {\node[draw,circle](\i_\j) at (\i,2-\j) {$\j$};}}
%\uncover<2-18>{\foreach \i/\j in {} {\node[draw,circle](\i_\j) at (\i,2-\j) {$\j$};}}
%\uncover<2-18>{\foreach \i/\j in {} {\node[draw,circle](\i_\j) at (\i,4-\j) {$\j$};}}
\uncover<3->{\draw (-0.5,3.7) node [scale=0.7] {$u_1=0.12$};}
\uncover<4-11>{\draw[->](-1_0)--(0_1);}
\uncover<5->{\draw[->](-1_1)--(0_0);}
\uncover<6->{\draw[->](-1_2)--(0_2);}
\uncover<7->{\foreach \i/\j in {-2/0,-2/2,-2/1} {\node[draw,circle](\i_\j) at (\i,2-\j) {$\j$};}}
%\uncover<7-18>{\foreach \i/\j in {} {\node[draw,circle](\i_\j) at (\i,4-\j) {$\j$};}}
\uncover<8->{\draw (-1.5,3.7) node [scale=0.7] {$u_2=0.32$};}
\uncover<9-17>{\draw[->](-2_0)--(-1_1);}
\uncover<10-17>{\draw[->](-2_1)--(-1_1);}
\uncover<11->{\draw[->](-2_2)--(-1_2);}
\uncover<12->{\draw[->,dash pattern=on 1.5pt off 1.5pt](-1_0)--(0_1);}
%\uncover<12->{\foreach \i/\j in {-2/0} {\node[draw,circle](\i_\j) at (\i,4-\j) {$\j$};
%}}
\uncover<13->{\foreach \i/\j in {-3/0,-3/1,-3/2} {\node[draw,circle](\i_\j) at (\i,2-\j) {$\j$};}}
\uncover<14->{\draw (-2.5,3.7) node [scale=0.7] {$u_3=0.92$};}
\uncover<15->{\draw[->](-3_0)--(-2_2);}
\uncover<16->{\draw[->](-3_1)--(-2_2);}
\uncover<17->{\draw[->](-3_2)--(-2_2);}

\uncover<18->{\draw[->,dash pattern=on 1.5pt off 1.5pt](-2_0)--(-1_1);}
\uncover<18->{\draw[->,dash pattern=on 1.5pt off 1.5pt](-2_1)--(-1_1);}
%\uncover<18->{\foreach \i/\j in {-2/1,-1/1,0/0} {\node[draw,circle](\i_\j) at (\i,4-\j) {$\j$};
%}}
\uncover<2-19>{\foreach \i/\j in {-3/0,-3/1,-3/2,-2/2,-1/2,0/2} {\node[draw,circle,fill=cyan!9](\i_\j) at (\i,2-\j) {$\j$};}}
\uncover<-20>{\foreach \i/\j in {0/2} {\node[draw,circle,fill=red!9](\i_\j) at (\i,2-\j) {$\j$};}}
\end{tikzpicture}
\end{center}
\caption{Les étape du couplage en arrière}
\end{figure}

Réponses

  • Si je comprends bien, le problème principal est de mettre \uncover<-20> au lieu de \uncover<20-> (tel quel, tu colories ce dernier état en rouge « jusqu'à l'étape 20 » et pas « à partir de l'étape 20 ».

    Par ailleurs, comme il y a 20 étapes et que ta ligne qui colorie les nœuds en bleus comporte <2-19>, elle n'est prise en compte pour la 20e étape.

    Ça doit aller en mettant à la place de tes deux lignes :
    \uncover<2->{\foreach \i/\j in {-3/0,-3/1,-3/2,-2/2,-1/2,0/2} {\node[draw,circle,fill=cyan!9](\i_\j) at (\i,2-\j) {$\j$};}}
    \uncover<20->{\foreach \i/\j in {0/2} {\node[draw,circle,fill=red!9](\i_\j) at (\i,2-\j) {$\j$};}}
    
    (Bien sûr, le nœud en (0,2) est colorié une fois en bleu et une fois en rose (red!9) mais ce n'est pas important.
Connectez-vous ou Inscrivez-vous pour répondre.