Last active
January 29, 2020 14:31
-
-
Save LS80/dd1ec164d58bceca87e300c338f2c11e to your computer and use it in GitHub Desktop.
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
import sys | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as mani | |
import requests | |
import numpy as np | |
session = requests.Session() | |
fig, axarr = plt.subplots(3, sharex=True) | |
def animate(i): | |
resp = session.get( | |
'http://192.168.1.5:8080/xyz_{}.csv'.format(sys.argv[1]), stream=True).raw | |
x, y, z = np.loadtxt(resp, delimiter=',', unpack=True) | |
for axis in axarr: | |
axis.clear() | |
axarr[0].plot(x) | |
axarr[1].plot(y) | |
axarr[2].plot(z) | |
ani = mani.FuncAnimation(fig, animate, interval=100) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment