def clear_plots(self): set_date_ticks(self.axes.xaxis, False) children = self.axes.get_children() for child in children: if child.get_gid() is not None: if child.get_gid() == 'plot': child.remove()
def __setup_plot(self): self.axes = self.figure.add_subplot(111) self.axes.set_xlabel("Time") self.axes.set_ylabel('Points') numFormatter = ScalarFormatter(useOffset=False) set_date_ticks(self.axes.xaxis, False) self.axes.yaxis.set_major_formatter(numFormatter) self.axes.yaxis.set_minor_locator(AutoMinorLocator(10)) now = time.time() self.axes.set_xlim(utc_to_mpl(now), utc_to_mpl(now - 10))
def run(self): if self.data is None: self.parent.threadPlot = None return total = len(self.data) if total > 0: self.parent.clear_plots() xs = [utc_to_mpl(x) for x in list(self.data.keys())] ys = [len(sweep) for sweep in list(self.data.values())] self.parent.plot = self.axes.plot(xs, ys, 'bo', gid='plot') set_date_ticks(self.axes.xaxis) self.parent.scale_plot() self.parent.redraw_plot() self.parent.threadPlot = None