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
def _setup_cursor(self): marker = Marker(label_cb=self.plot.label_info, constraint_cb=self.plot.on_plot) marker.rts = [0] setup_marker_param(marker, {"symbol.size": 0, "symbol.alpha": 0.0, "sel_symbol.size": 0, "sel_symbol.alpha": 0.0, "line.color": "#909090", "line.width": 1.0, "line.style": "SolidLine", "sel_line.color": "#909090", "sel_line.width": 1.0, "sel_line.style": "SolidLine", "markerstyle": "VLine"}) marker.attach(self.plot) self.marker = marker self._setup_cursor_info(marker)
def _setup_cursor(self): marker = Marker(label_cb=self.plot.label_info, constraint_cb=self.plot.on_plot) marker.rts = [0] setup_marker_param( marker, { "symbol.size": 0, "symbol.alpha": 0.0, "sel_symbol.size": 0, "sel_symbol.alpha": 0.0, "line.color": "#909090", "line.width": 1.0, "line.style": "SolidLine", "sel_line.color": "#909090", "sel_line.width": 1.0, "sel_line.style": "SolidLine", "markerstyle": "VLine" }) marker.attach(self.plot) self.marker = marker self._setup_cursor_info(marker)