def __setup_plot(self): figure = Figure(facecolor='lightgrey') self._axes = figure.add_subplot(111) self._axes.set_title('Spectrum') self._axes.set_xlabel('Frequency (MHz)') self._axes.set_ylabel('Level (dB)') self._axes.autoscale_view(True, True, True) self._axes.grid(True) self._spectrum, = self._axes.plot([], [], 'b-', label='Spectrum') self._canvas = FigureCanvas(self._panelPlot, -1, figure) self._canvas.mpl_connect('motion_notify_event', self.__on_motion) Legend.__init__(self, self._axes, self._canvas)
def __setup_plot(self): figure = Figure(facecolor='lightgrey') self._axes = figure.add_subplot(111) self._axes.set_title('Timeline') self._axes.set_xlabel('Time') self._axes.set_ylabel('Frequency (MHz)') self._axes.grid(True) locator = AutoDateLocator() formatter = AutoDateFormatter(locator) self._axes.xaxis.set_major_formatter(formatter) self._axes.xaxis.set_major_locator(locator) formatter = ScalarFormatter(useOffset=False) self._axes.yaxis.set_major_formatter(formatter) self._axes.yaxis.set_minor_locator(AutoMinorLocator(10)) self._canvas = FigureCanvas(self._panelPlot, -1, figure) self._canvas.mpl_connect('motion_notify_event', self.__on_motion) Legend.__init__(self, self._axes, self._canvas)