Skip to content

Instantly share code, notes, and snippets.

@kevinmehall
Created June 10, 2016 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinmehall/0880a544fcc40ac38d67bff58ead9341 to your computer and use it in GitHub Desktop.
Save kevinmehall/0880a544fcc40ac38d67bff58ead9341 to your computer and use it in GitHub Desktop.
import sys
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
f = open(sys.argv[1])
f.next()
f.next()
ts = []
xs = []
ys = []
zs = []
for line in f:
line = line.split()
if line[5] != '5': # mode not single
t, x, y, z = map(float, line[1:5])
ts.append(t)
xs.append(x)
ys.append(y)
zs.append(z)
ax.plot(xs, ys, zs)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment