I am making an animation based on this answer. My problem is that as I animate, the value of time changes (e.g. from 0 ns to 100 ns), hence the size of the number changes, and the text ns moves back and forth. How can I fix the text's position, or get the coordinates (and maybe place it manually with this). Here is the code I am using:
\documentclass[t]{beamer}
\usepackage{animate}
\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}
\usepackage{siunitx}
\begin{filecontents*}{time-0.txt}
0
\end{filecontents*}
\begin{filecontents*}{time-1.txt}
100
\end{filecontents*}
\begin{document}
\begin{frame}{Electron Evolution}
\pgfplotsset{compat=1.16}
\centering
\begin{animateinline}[loop,autoplay]{1}
%Schrodinger cat:https://tex.stackexchange.com/questions/544116/place-subfigures-in-l-shape/544119?noredirect=1#comment1375147_544119
\multiframe{2}{i = 0 + 1}
{
\begin{tikzpicture}
\begin{groupplot}[group style={group size=2 by 2,
horizontal sep=1.2em,vertical sep=1.5em},
xmin=0,height=4cm,width=5cm,no markers,
ticklabel style = {font=\tiny},
yticklabel pos=right,
xlabel near ticks,
xlabel style= {font=\tiny},
ylabel near ticks,
ylabel style= {font=\tiny},
]
\nextgroupplot[group/empty plot,alias=TL]
\nextgroupplot[ylabel = {Particle Density~[m$^{-3}$]},
xtick=\empty,
ymin = 0,
ymax = 77162484572430.92,
xmin = 0.03157490368073539,
xmax = 0.03653007600471181]
%
\nextgroupplot[
ytick=\empty,
xlabel = {Probability Density},
ymin = -217828.00503348646,
ymax = 213540.67299828946,
xmax = 1.1333435035653558e-05,
xmin = 0,
x dir = reverse,
]
%
\nextgroupplot[
ylabel = {Speed~[m/s]},
xlabel = {$z$~[m]},
xmin = 0.03157490368073539,
xmax = 0.03653007600471181,
ymin = -217828.00503348646,
ymax = 213540.67299828946,
]
\end{groupplot}
\path (TL) node[align=left,font=\scriptsize]{$t=$ \input{time-\i.txt}~ns\\[0.6em]
$r=\SI{0}{\meter}$\\[0.6em]
$585$ macro-particles\\[0.6em]
$\overline{T} = \SI{152.4}{\kelvin}$};
\end{tikzpicture}
}
\end{animateinline}
\end{frame}
\end{document}
\parboxof sufficient width\parbox{1.5em}{\input{time-\i.txt}}– BambOo May 15 '20 at 20:25\parboxis misaligned with the rest of the text. It is a bit lower. I have tried\parbox{1.5em}{\centering \input{time-\i.txt}}without success. Do you have any suggestions that may solve this? Thanks. – Daniel Duque May 15 '20 at 21:29\centeringis for horizontal alignment, not vertical – BambOo May 15 '20 at 21:37[b]option of\parboxto have the correct alignment – BambOo May 15 '20 at 21:42