-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplots.py
More file actions
78 lines (66 loc) · 2 KB
/
Copy pathplots.py
File metadata and controls
78 lines (66 loc) · 2 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
from math import *
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
denseGrid = open("data/denseGrid copy.txt")
brickmap = open("data/brickmap copy.txt")
X = [2*pi*i/1000 for i in range(1000)]
YdenseGridArray = [
[float(denseGrid.readline())*1000 for _ in range(1000)] for _ in range(100)
]
YdenseGrid = []
YdenseGridTop = []
YdenseGridBot = []
for i in range(1000):
val = 0
max = YdenseGridArray[0][i]
min = YdenseGridArray[0][i]
for j in range(100):
current = YdenseGridArray[j][i]
val += current
if current>max : max = current
if current<min : min = current
val /= 100
YdenseGrid.append(val)
YdenseGridTop.append(max)
YdenseGridBot.append(min)
YbrickmapArray = [
[float(brickmap.readline())*1000 for _ in range(1000)] for _ in range(100)
]
Ybrickmap = []
YbrickmapTop = []
YbrickmapBot = []
for i in range(1000):
val = 0
max = YbrickmapArray[0][i]
min = YbrickmapArray[0][i]
for j in range(100):
current = YbrickmapArray[j][i]
val += current
if current>max : max = current
if current<min : min = current
val /= 100
Ybrickmap.append(val)
YbrickmapTop.append(max)
YbrickmapBot.append(min)
denseGrid.close()
brickmap.close()
fig, ax = plt.subplots()
col1 = "C0"
col2 = "C1"
#plt.fill_between(X, YdenseGridTop, YdenseGridBot, alpha=.5)
plt.plot(X, YdenseGrid, linewidth = 2., color = col1)
plt.plot(X, Ybrickmap, linewidth = 2., color = col2)
red_patch = mpatches.Patch(color=col1, label='Dense Grid')
blue_patch = mpatches.Patch(color=col2, label='Brickmap')
ax.legend(handles=[red_patch, blue_patch])
plt.xlabel("Rotation - rad")
plt.ylabel("Temps moyen de l'echantillon - ms")
#plt.fill_between(X, YbrickmapTop, YbrickmapBot, alpha=.5)
plt.show()
fig, ax = plt.subplots()
tags = ['Dense Grid', 'Brickmap', 'Octree']
c = [32**4, 24*512*32, 721*32]
bar_colors = ['tab:red', 'tab:blue', 'tab:orange']
ax.bar(tags, c, color=bar_colors)
ax.set_ylabel('Taille - bits')
plt.show()