-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnumpy_plot.py
35 lines (30 loc) · 1.08 KB
/
numpy_plot.py
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
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import cm as CM
import matplotlib as mpl
from scipy.misc import imread
from utils import *
for i in range(0,6):
data = load_csv('data/position_data_raw.csv', delimiter=",", select=TimesliceSelect(i).select, skiprows=1)
print "loaded"
ID = data[:, 0]
T = data[:, 1]
X = data[:, 2]
Y = data[:, 3]
print len(X)
C = np.hstack((ID[:, np.newaxis], T[:, np.newaxis]))
eval = Evaluator()
fig=plt.figure(figsize=(10.24, 20.24), dpi=100)
#fig.add_subplot(211)
img = imread('Minimap.jpg')
plt.hexbin(X, Y, C=C,
reduce_C_function=eval.compute_visits,
gridsize=120, cmap=CM.jet, bins=None, alpha=1, edgecolors='none', norm=mpl.colors.LogNorm(), mincnt=1)
plt.axis([-8200, 7930.0, -8400.0, 8080.0])
#plt.colorbar()
plt.axis('off')
plt.imshow(img, zorder=0, extent=[-8200, 7930.0, -8400.0, 8080.0])
#fig.add_subplot(212)
#plt.hist(eval.scores, bins=100)
plt.savefig("time_{}.png".format(i), bbox_inches='tight', dpi=100)
plt.clf()