-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplotFromFile.py
More file actions
25 lines (20 loc) · 836 Bytes
/
plotFromFile.py
File metadata and controls
25 lines (20 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Created 2018 by Lukas Kaul
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
def printData(path, basename):
print "plotting from file ", path+basename+'.csv'
data = np.genfromtxt(path+basename+'.csv', delimiter=',', skip_header=1, skip_footer=1, names=['time', 'Fx', 'Fy', 'Fz', 'Tx', 'Ty', 'Tz'])
plt.plot(data['time'], data['Fx'], color='r', label='Fx')
plt.plot(data['time'], data['Fy'], color='g', label='Fy')
plt.plot(data['time'], data['Fz'], color='b', label='Fz')
plt.plot(data['time'], data['Tx'], color='r', label='Tx')
plt.plot(data['time'], data['Ty'], color='g', label='Ty')
plt.plot(data['time'], data['Tz'], color='b', label='Tz')
plt.legend()
plt.show()
basename = raw_input('Enter file basename: ')
printData('NetFT/', basename)