-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotter.py
More file actions
28 lines (22 loc) · 699 Bytes
/
Copy pathplotter.py
File metadata and controls
28 lines (22 loc) · 699 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
import matplotlib.pyplot as plt
import numpy as np
import config
class Plotter:
def plot_events(self, events, title="no title", start=0, end=9000):
fig = plt.figure()
ax = fig.add_subplot(projection="3d")
ax.set_title(title)
xs = events[:, 0]
ys = events[:, 3]
zs = events[:, 1]
ax.scatter(xs, ys, zs, s=.01, marker=".", )
def plot_image(self, img, title='no title'):
fig = plt.figure()
ax = fig.add_subplot()
ax.set_title(title)
plt.gca().invert_yaxis()
# img = img / np.max(img)
img = np.clip(img, 0, 1)
ax.imshow(img, cmap="gray")
def show(self):
plt.show()