multiframe bersarang

Oct 20 2020

Saya bertanya-tanya apakah yang berikut ini mungkin. Saya ingin menumpuk lingkungan animateinline dan multiframe untuk mensimulasikan ketergantungan waktu sinyal untuk parameter yang berbeda. Sesuatu seperti itu:

\documentclass{standalone}
\usepackage{tikz}
\usepackage{animate}

\begin{document}
   \centering
%\begin{animateinline}[poster=first, label=graph_switch,controls=step]{2}
 %     \multiframe{20}{rt=0+5}{%
 \def\rs{1}
\begin{animateinline}[poster=first, label=graph_switch, autoplay]{5}
    \multiframe{15}{rt=0+5}{%
        \begin{tikzpicture}
        %draw coordinate axis
        \draw[thick, color=black, -latex] (-4.05,0) -- (4.05,0) node[right]{$y$};              
        \draw[thick, color=black, -latex] (0,-1.4) -- (0,1.4) node[above]{$t$};
         \draw[scale=1, domain=-4:4, smooth, variable=\t, blue] plot ({\t}, {\rs*sin(100*\t+\rt)});
        \node at (5,5) {};
        \node at (-5,-5) {}; 
        \end{tikzpicture}
    }%
\end{animateinline}
% }%
% \end{animateinline}
 \end{document}

Namun, tampaknya penumpukan seperti itu tidak mungkin dan menghapus komentar pada 4 baris dari contoh membawa kesalahan. Apakah ada solusi untuk menyajikan sesuatu yang serupa?

Jawaban

1 AlexG Oct 20 2020 at 18:43

Membagi animasi menjadi beberapa bagian bisa dilakukan seperti ini. Dalam contoh ini, dua bagian dipisahkan oleh pause ( \newframe*). Klik untuk melanjutkan.

\documentclass{standalone}
\usepackage{tikz}
\usepackage{animate}

\begin{document}
\begin{animateinline}[poster=first, label=graph_switch, autoplay]{5}
  \multiframe{15}{rt=0+5}{%
    \def\rs{1}%
    \begin{tikzpicture}
    %draw coordinate axis
    \draw[thick, color=black, -latex] (-4.05,0) -- (4.05,0) node[right]{$y$};              
    \draw[thick, color=black, -latex] (0,-1.4) -- (0,1.4) node[above]{$t$};
      \draw[scale=1, domain=-4:4, smooth, variable=\t, blue] plot ({\t}, {\rs*sin(100*\t+\rt)});
      \node [anchor=north east] at (4,2) {$A=1$};
%    \node at (5,5) {};
%    \node at (-5,-5) {}; 
    \end{tikzpicture}
  }%
  \newframe*
  \multiframe{15}{rt=0+5}{%
    \def\rs{0.5}%
    \begin{tikzpicture}
    %draw coordinate axis
    \draw[thick, color=black, -latex] (-4.05,0) -- (4.05,0) node[right]{$y$};              
    \draw[thick, color=black, -latex] (0,-1.4) -- (0,1.4) node[above]{$t$};
      \draw[scale=1, domain=-4:4, smooth, variable=\t, blue] plot ({\t}, {\rs*sin(100*\t+\rt)});
      \node [anchor=north east] at (4,2) {$A=0.5$};
%    \node at (5,5) {};
%    \node at (-5,-5) {}; 
    \end{tikzpicture}
  }%
\end{animateinline}
\end{document}