MCPcopy Create free account
hub / github.com/PiLiDAR/PiLiDAR / __init__

Method __init__

lib/matplotlib_2D.py:7–26  ·  view source on GitHub ↗
(self, pause=0.005, plotrange=1000, s=1)

Source from the content-addressed store, hash-verified

5
6class plot_2D:
7 def __init__(self, pause=0.005, plotrange=1000, s=1):
8 self.x_list = np.array([])
9 self.y_list = np.array([])
10 self.color_list = np.array([])
11
12 self.fig = plt.figure(figsize=(8, 8))
13 self.fig.patch.set_facecolor('black') # set the figure's background color to black
14 self.ax = self.fig.add_subplot(111)
15 self.plotrange = plotrange
16 self.ax.set_ylim([-self.plotrange, self.plotrange])
17 self.ax.set_xlim([-self.plotrange, self.plotrange])
18 self.ax.set_title('LiDAR', fontsize=18)
19 self.ax.set_facecolor('black')
20 # self.ax.xaxis.grid(True, color='yellow', linestyle='dashed')
21 # self.ax.yaxis.grid(True, color='yellow', linestyle='dashed')
22 # self.ax.set_xticks(np.arange(-self.plotrange, self.plotrange+1, 100))
23 # self.ax.set_yticks(np.arange(-self.plotrange, self.plotrange+1, 100))
24 self.ani = self.__initialize_animation__()
25 self.pause = pause
26 self.s = s
27
28 def __initialize_animation__(self):
29 return animation.FuncAnimation(self.fig, self.animate, init_func=self.init, frames=1, interval=1, blit=True)

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected