I'm interested in creating a plot using TikZ or pgfplots together with the animate package.
The plot should consist of a square impulse that is moving along the z axis. As it moves it should lose its "squarness" and become a smoother impulse (see the image).
I suspect this could be done in two ways:
- Define an impulse function of time(
\it) which would change accordingly. - Draw a TikZ path with appropriate decorations that
change with a parameter (
\it).
How could this be done?
My first try:
\documentclass{article}
\usepackage{tikz,pgfplots}
\usepackage[poster=first, controls, buttonsize=0.8em]{animate}
\begin{document}
\begin{animateinline}{10}
\multiframe{11}{it=0+1}{
\begin{tikzpicture}
\begin{axis} [
xmax = 15,
ymax = 4,
]
\addplot[domain = 0:20] coordinates {(0,0) (\it+1,0) (\it+1,1) (\it+2,1) (\it+2,0) (\it+5,0)};
\end{axis}
\end{tikzpicture}
}
\end{animateinline}%
\end{document}



