-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#! /usr/bin/env python | ||
|
||
import numpy as np | ||
import glob | ||
import matplotlib.pyplot as plt | ||
from matplotlib.animation import FuncAnimation | ||
|
||
# get the filenames, make sure they are sorted in time | ||
f = glob.glob('run1/tab/LinWave*tab') | ||
f.sort() | ||
|
||
# 1-based columns numbers for now | ||
xcol = 3 | ||
ycol = 5 | ||
|
||
# delay in ms | ||
delay=100 | ||
|
||
# create the figure and axes objects | ||
fig, ax = plt.subplots() | ||
|
||
# function that draws each frame of the animation | ||
def animate(i): | ||
# print(f[i]) | ||
d = np.loadtxt(f[i]).T | ||
x = d[xcol-1] | ||
y = d[ycol-1] | ||
|
||
ax.clear() | ||
ax.plot(x, y) | ||
#ax.set_xlim([0,20]) | ||
#ax.set_ylim([0,10]) | ||
ax.set_title(f[i]) | ||
|
||
|
||
# run the animation | ||
ani = FuncAnimation(fig, animate, frames=len(f), interval=delay, repeat=False) | ||
|
||
plt.show() | ||
|