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()
评论列表
文章目录