def __init__(self, *args, **kwargs): QtGui.QMainWindow.__init__(self, *args, **kwargs) self._grw = InteractiveGRWidget() self.setCentralWidget(self._grw) viewport = [0.1, 0.88, 0.1, 0.88] self.curve = DependentPlotCurve([0], [0], linecolor=4) self.peakbars = PeakBars([], [], linecolor=2) self.curve.dependent = [self.peakbars] axes = ClampedPlotAxes(viewport, 50, 5, 1, 2) axes.setWindow(50, 25000, 0, 100) axes.addCurves(self.curve) plot = Plot(viewport).addAxes(axes) plot.title = "QtGR Power Spectrum" plot.subTitle = "Capturing Microphone" axes.scale = gr.OPTION_X_LOG self._grw.addPlot(plot) timer = QtCore.QTimer(self) timer.timeout.connect(self.updateData) timer.start(40)
def __init__(self, *args, **kwargs): QtGui.QMainWindow.__init__(self, *args, **kwargs) self._grw = InteractiveGRWidget() self.setCentralWidget(self._grw) viewport = [0.1, 0.88, 0.1, 0.88] x = arange(0, 2 * pi, 0.01) y = sin(x) self.curve = PlotCurve(x, y) axes = ScaledPlotAxes(viewport) axes.addCurves(self.curve) plot = Plot(viewport).addAxes(axes) plot.title = "QtGR Timer example" plot.subTitle = "Plotting Live-Data" plot.xlabel = "t" plot.ylabel = "sin(t)" plot.autoscale = PlotAxes.SCALE_X | PlotAxes.SCALE_Y self._grw.addPlot(plot) timer = QtCore.QTimer(self) timer.timeout.connect(self.updateData) timer.start(40)