def __init__(self, parent=None):
        super(MzPlottingWidget, self).__init__(parent, xlabel="mz", ylabel="I")

        patch_inner_plot_object(self, MzPlot)
        self.plot.centralMz = None

        def label(self, x):
            # label with full precision:
            return QwtText(str(x))

        a = QwtScaleDraw()
        a.label = new.instancemethod(label, self.plot, QwtScaleDraw)
        self.plot.setAxisScaleDraw(self.plot.xBottom, a)

        self.pm = PlotManager(self)
        self.pm.add_plot(self.plot)
        self.curve = make_unselectable_curve([], [],
                                             color="b",
                                             curvestyle="Sticks")

        self.plot.add_item(self.curve)

        t = self.pm.add_tool(MzSelectionTool)
        self.pm.set_default_tool(t)
        t.activate()

        marker = Marker(label_cb=self.plot.label_info,
                        constraint_cb=self.plot.on_plot)
        marker.attach(self.plot)

        line = make_measurement_line()
        line.setVisible(0)

        setupCommonStyle(line, marker)
        line.shapeparam.line.color = "#555555"
        line.shapeparam.update_shape(line)

        label = make.info_label("TR", [MzCursorInfo(marker, line)], title=None)
        label.labelparam.label = ""
        label.labelparam.font.size = 12
        label.labelparam.update_label(label)

        self.marker = marker
        self.label = label
        self.line = line
Example #2
0
    def __init__(self, parent=None):
        super(MzPlottingWidget, self).__init__(parent, xlabel="mz", ylabel="I")

        patch_inner_plot_object(self, MzPlot)
        self.plot.centralMz = None

        def label(self, x):
            # label with full precision:
            return QwtText(str(x))

        a = QwtScaleDraw()
        a.label = new.instancemethod(label, self.plot, QwtScaleDraw)
        self.plot.setAxisScaleDraw(self.plot.xBottom, a)

        self.pm = PlotManager(self)
        self.pm.add_plot(self.plot)
        self.curve = make_unselectable_curve([], [], color="b", curvestyle="Sticks")

        self.plot.add_item(self.curve)

        t = self.pm.add_tool(MzSelectionTool)
        self.pm.set_default_tool(t)
        t.activate()

        marker = Marker(label_cb=self.plot.label_info, constraint_cb=self.plot.on_plot)
        marker.attach(self.plot)

        line = make_measurement_line()
        line.setVisible(0)

        setupCommonStyle(line, marker)
        line.shapeparam.line.color = "#555555"
        line.shapeparam.update_shape(line)

        label = make.info_label("TR", [MzCursorInfo(marker, line)], title=None)
        label.labelparam.label = ""
        label.labelparam.font.size = 12
        label.labelparam.update_label(label)

        self.marker = marker
        self.label = label
        self.line = line
Example #3
0
 def __init__(self, parent=None, with_range=True):
     super(EicPlottingWidget, self).__init__(parent, ylabel="I")
     patch_inner_plot_object(self, EicPlot)
     self._with_range = with_range
     self._setup_plot()
 def __init__(self, parent=None, with_range=True):
     super(EicPlottingWidget, self).__init__(parent, ylabel="I")
     patch_inner_plot_object(self, EicPlot)
     self._with_range = with_range
     self._setup_plot()