plotter_impls.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:live-plotter 作者: anandtrex 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号