def plot_loop(self, image, it):
"""
The actual function that updates the data in the plot initialized in :meth:`~.init`
:param image: The image that is recorded with :class:`~.PlotRecorder`. It should be a 2-D numpy array
:param it: The iteration number (independent of the actual x value)
:return:
"""
logger.debug("Plotting %s in %s", self.var_name, self.entity_name)
assert isinstance(image, np.ndarray), "The passed in image should by a numpy array"
assert len(image.shape) == 2, "The image to be shown should be 2-dimensional"
if it == 0:
self.im = self.ax.imshow(image, **self.imshow_kwargs)
else:
if it % self.plot_frequency == 0:
self.im.set_array(image)
评论列表
文章目录