Skip to content

Instantly share code, notes, and snippets.

@RustingSword
Created August 6, 2014 08:15
Show Gist options
  • Save RustingSword/51c4052b1f0fce1d930f to your computer and use it in GitHub Desktop.
Save RustingSword/51c4052b1f0fce1d930f to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt
import sys
#plt.rc('text', usetex=True)
#plt.rc('font', **{'family':'monospace','monospace':['Ubuntu Mono'], 'size':16})
#mpl.rcParams['legend.fontsize'] = 10
fig = plt.figure()
ax = fig.gca(projection='3d')
for index, i in enumerate(sys.argv[1:]):
data = np.loadtxt(i, skiprows=1, usecols=(0,1))
z = np.linspace(0, len(data), len(data))
ax.plot(z, data[:,0], data[:,1], label=i, linestyle='--', marker='+')
ax.set_xlabel('Time')
ax.set_ylabel('x position')
ax.set_zlabel('y position')
ax.legend()
#ax.view_init(elev=18,azim=-45)
#fig.tight_layout()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment