From b62a906bc7550841dc73c1e2c36a57629c72bef7 Mon Sep 17 00:00:00 2001 From: Peter Teuben Date: Fri, 30 Jun 2023 00:07:07 -0400 Subject: [PATCH] proper labels --- animate2 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/animate2 b/animate2 index 4f991d5..ae352fb 100755 --- a/animate2 +++ b/animate2 @@ -25,7 +25,9 @@ def xycols(fname, xcol, ycol): return (ixcol,iycol) # 1-based columns numbers from the column names -(xcol,ycol) = xycols(f[0],'x1v','velx') +xcol='x1v' +ycol='velx' +(ixcol,iycol) = xycols(f[0],xcol,ycol) # delay in ms delay=100 @@ -37,14 +39,16 @@ fig, ax = plt.subplots() def animate(i): # print(f[i]) d = np.loadtxt(f[i]).T - x = d[xcol-1] - y = d[ycol-1] + x = d[ixcol-1] + y = d[iycol-1] ax.clear() ax.plot(x, y) #ax.set_xlim([0,20]) #ax.set_ylim([0,10]) ax.set_title(f[i]) + ax.set_xlabel(xcol) + ax.set_ylabel(ycol) # run the animation