(self, points_2d)
| 49 | # plt.pause(self.pause) |
| 50 | |
| 51 | def update(self, points_2d): # points_2d: np.array([[x, y, luminance], ...]) |
| 52 | line = getattr(self, 'line', None) |
| 53 | if line is not None: |
| 54 | line.remove() |
| 55 | |
| 56 | self.x_list = points_2d[:, 0] |
| 57 | self.y_list = points_2d[:, 1] |
| 58 | self.color_list = self.__gray2rgb__(points_2d[:, 2]) |
| 59 | |
| 60 | self.line = self.ax.scatter(self.x_list, self.y_list, c=self.color_list/255, s=self.s) |
| 61 | |
| 62 | # # Set the plot range based on the maximum absolute value in x_list and y_list |
| 63 | # self.plotrange = max(max(abs(self.x_list)), max(abs(self.y_list))) |
| 64 | # self.ax.set_xlim([-self.plotrange, self.plotrange]) |
| 65 | # self.ax.set_ylim([-self.plotrange, self.plotrange]) |
| 66 | |
| 67 | plt.pause(self.pause) |
| 68 | |
| 69 | def close(self): |
| 70 | plt.close() |
no test coverage detected