plotter.py 文件源码

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

项目:DGP 作者: DynamicGravitySystems 项目源码 文件源码
def generate_subplots(self, rows: int) -> None:
        """Generate vertically stacked subplots for comparing data"""
        # TODO: Experimenting with generating multiple plots, work with Chris on this class
        # def set_x_formatter(axes):
        #     print("Xlimit changed")
        #     axes.get_xaxis().set_major_formatter(DateFormatter('%H:%M:%S'))

        # Clear any current axes first
        self._axes = []
        for i in range(rows):
            if i == 0:
                sp = self.figure.add_subplot(rows, 1, i+1)  # type: Axes
            else:  # Share x-axis with plot 0
                sp = self.figure.add_subplot(rows, 1, i + 1, sharex=self._axes[0])  # type: Axes

            sp.grid(True)
            sp.name = 'Axes {}'.format(i)
            # sp.callbacks.connect('xlim_changed', set_x_formatter)
            self._axes.append(sp)
            i += 1

        self.compute_initial_figure()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号