-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrender.py
More file actions
55 lines (39 loc) · 980 Bytes
/
render.py
File metadata and controls
55 lines (39 loc) · 980 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import csv
import matplotlib.pyplot as plt
fileName = input("Enter file name: ")
file = open (f"{fileName}.csv")
type(file)
csvreader = csv.reader(file)
rows = []
for row in csvreader:
rows.append(row)
file.close()
# cleanedPoints = []
#
# for i in range(1, len(rows)):
# cleanedPoints.append([])
#
# for j in range(0, len(rows[i]) - 1):
# cleanedPoints[i - 1].append(float(rows[i][j]))
cleanedPoints = []
for i in range(1, len(rows)):
cleanedPoints.append([])
for j in range(1, len(rows[i]) - 2):
cleanedPoints[i - 1].append(float(rows[i][j]))
x = []
y = []
for i in range(0, len(cleanedPoints)):
x.append(cleanedPoints[i][0])
y.append(cleanedPoints[i][1])
print(cleanedPoints)
print(x)
print(y)
plt.plot(x, y, color = 'g', linestyle = 'dashed',
marker = 'o',label = "Path")
plt.xticks(rotation = 25)
plt.xlabel('x (in)')
plt.ylabel('y (in)')
plt.title('Path', fontsize = 20)
plt.grid()
plt.legend()
plt.show()