本文整理汇总了Python中guiqwt.plot.PlotManager类的典型用法代码示例。如果您正苦于以下问题:Python PlotManager类的具体用法?Python PlotManager怎么用?Python PlotManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PlotManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, wintitle="guiqwt plot", icon="guiqwt.png",
toolbar=False, options=None, parent=None, panels=None):
QDialog.__init__(self, parent)
self.setWindowFlags(Qt.Window)
# WidgetMixin copy
PlotManager.__init__(self, main=self)
self.main_layout = QVBoxLayout(self)
self.color_layout = QHBoxLayout()
self.plot_layout = QGridLayout()
self.option_layout = QHBoxLayout()
self.plot_widget = None
if panels is not None:
for panel in panels:
self.add_panel(panel)
self.toolbar = QToolBar(_("Tools"))
if not toolbar:
self.toolbar.hide()
# Configuring widget layout
self._setup_widget_properties(wintitle=wintitle, icon=icon)
self._setup_widget_layout()
# Options
self.option_callbacks = {}
self.legend = None
示例2: __initLayout
def __initLayout(self):
# layout
layout = QGridLayout()
central_widget = QWidget(self)
central_widget.setLayout(layout)
self.setCentralWidget(central_widget)
# create plot manager
self.__p_manager = PlotManager(self)
# toolbar
if (self.__p_toolbar):
self.__p_toolbar.clear()
else:
self.__p_toolbar = self.addToolBar("tools")
# end if
# resize button
icon = QIcon("icons/center.png")
button = QToolButton()
button.setIcon(icon)
button.setToolTip("Resize")
self.connect(button, SIGNAL("clicked()"), self.__onAutoScale)
self.__p_manager.add_toolbar(self.__p_toolbar, id(self.__p_toolbar))
self.__p_toolbar.addWidget(button)
self.__v_wasInitialized = True
示例3: __init__
def __init__(self, parent=None, rangeSelectionCallback=None):
PlotterBase.__init__(self, "RT", "I")
self.rangeSelectionCallback = rangeSelectionCallback
widget = self.widget
widget.plot.__class__ = RtPlot
self.pm = PlotManager(widget)
self.pm.add_plot(widget.plot)
t = self.pm.add_tool(RtSelectionTool)
t.activate()
self.pm.set_default_tool(t)
marker = Marker(label_cb=self.widget.plot.label_info,
constraint_cb=self.widget.plot.on_plot)
marker.rts = [0]
setupStyleRtMarker(marker)
marker.attach(self.widget.plot)
self.marker = marker
self.cursor_info = RtCursorInfo(marker)
label = make.info_label("T", [self.cursor_info], title=None)
label.labelparam.label = ""
label.labelparam.font.size = 12
label.labelparam.border.color = "#ffffff"
label.labelparam.update_label(label)
self.label = label
self.minRTRangeSelected = None
self.maxRTRangeSelected = None
示例4: __setup_layout
def __setup_layout( self ):
self.connect( self.button, QtCore.SIGNAL( 'clicked()' ), self.button_Click )
self.connect( self.button2, QtCore.SIGNAL( 'clicked()' ), self.button_Click2 )
self.connect( self.button3, QtCore.SIGNAL( 'clicked()' ), self.button_Click3 )
self.connect( self.button4, QtCore.SIGNAL( 'clicked()' ), self.button_Click4 )
self.connect( self.button5, QtCore.SIGNAL( 'clicked()' ), self.button_Click5 )
self.connect( self.button6, QtCore.SIGNAL( 'clicked()' ), self.button_Click6 )
# Vertical cursor
self.cursorposition = 0.8
self.cursorposition2 = 1.2
self.vcursor1 = make.vcursor(self.cursorposition, label='x = %.2f')
self.plot.add_item( self.vcursor1 )
self.vcursor2 = make.vcursor(self.cursorposition2, label='x = %.2f')
self.plot.add_item( self.vcursor2 )
# Define the y label, x might change depending on user definition
CurvePlot.set_axis_title(self.plot,CurvePlot.Y_LEFT,"Intensity (counts)")
# Crate the PlotManager
self.manager = PlotManager( self )
self.manager.add_plot( self.plot )
self.manager.add_plot( self.plot2 )
# Create Toolbar
toolbar = self.addToolBar( 'tools' )
self.manager.add_toolbar( toolbar, id( toolbar ) )
# Register the ToolBar's type
self.manager.register_all_curve_tools( )
# self.manager.register_other_tools()
# Register a custom tool
self.manager.add_tool( SelectPointTool, title = 'Position', on_active_item = True, mode = 'create' )
示例5: __init__
def __init__(self, wintitle):
super(Window, self).__init__()
self.default_tool = None
self.plots = []
self.itemlist = PlotItemList(None)
self.contrast = ContrastAdjustment(None)
self.xcsw = XCrossSection(None)
self.ycsw = YCrossSection(None)
self.manager = PlotManager(self)
self.toolbar = QToolBar(_("Tools"), self)
self.manager.add_toolbar(self.toolbar, "default")
self.toolbar.setMovable(True)
self.toolbar.setFloatable(True)
self.addToolBar(Qt.TopToolBarArea, self.toolbar)
frame = QFrame(self)
self.setCentralWidget(frame)
self.layout = QGridLayout()
layout = QVBoxLayout(frame)
frame.setLayout(layout)
layout.addLayout(self.layout)
self.frame = frame
self.setWindowTitle(wintitle)
self.setWindowIcon(get_icon('guiqwt.svg'))
示例6: __init__
def __init__(self):
super(RealtimeDemo, self).__init__()
self.setWindowTitle(u"Realtime Demo")
self.data = {u"t": array("d")}
for name in sum(PLOT_DEFINE, []):
self.data[name] = array("d")
self.curves = {}
self.t = 0
vbox = QVBoxLayout()
vbox.addWidget(self.setup_toolbar())
self.manager = PlotManager(self)
self.plots = []
for i, define in enumerate(PLOT_DEFINE):
plot = CurvePlot()
plot.axisScaleDraw(CurvePlot.Y_LEFT).setMinimumExtent(60)
self.manager.add_plot(plot)
self.plots.append(plot)
plot.plot_id = id(plot)
for j, curve_name in enumerate(define):
curve = self.curves[curve_name] = make.curve([0], [0], color=COLORS[j], title=curve_name)
plot.add_item(curve)
plot.add_item(make.legend("BL"))
vbox.addWidget(plot)
self.manager.register_standard_tools()
self.manager.get_default_tool().activate()
self.manager.synchronize_axis(CurvePlot.X_BOTTOM, self.manager.plots.keys())
self.setLayout(vbox)
self.startTimer(100)
示例7: __init__
def __init__(self, rangeSelectionCallback=None):
super(RtPlotter, self).__init__("RT", "I")
self.rangeSelectionCallback = rangeSelectionCallback
widget = self.widget
widget.plot.__class__ = RtPlot
# todo: refactor as helper
a = QwtScaleDraw()
# render tic labels in modfied format:
label = lambda self, v: QwtText(formatSeconds(v))
a.label = new.instancemethod(label, widget.plot, QwtScaleDraw)
widget.plot.setAxisScaleDraw(widget.plot.xBottom, a)
self.pm = PlotManager(widget)
self.pm.add_plot(widget.plot)
t = self.pm.add_tool(RtSelectionTool)
self.addTool(RtSelectionTool)
self.pm.set_default_tool(t)
marker = Marker(label_cb=self.widget.plot.label_info,
constraint_cb=self.widget.plot.on_plot)
marker.rts = [0]
setupStyleRtMarker(marker)
marker.attach(self.widget.plot)
self.marker = marker
label = make.info_label("T", [RtCursorInfo(marker)], title=None)
label.labelparam.label = ""
self.label = label
self.minRTRangeSelected = None
self.maxRTRangeSelected = None
示例8: __init__
def __init__(self, wintitle='Plot window', major_grid=True,
minor_grid=False, toolbar=True, parent=None,
panels=None, min_plot_width=100, min_plot_height=75):
QDialog.__init__(self, parent)
self.setWindowFlags(Qt.Window)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(':/Application/Main')),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.setWindowIcon(icon)
self.major_grid = major_grid
self.minor_grid = minor_grid
self.min_plot_width = min_plot_width
self.min_plot_height = min_plot_height
# WidgetMixin copy
PlotManager.__init__(self, main=self)
self.main_layout = QVBoxLayout(self)
self.color_layout = QHBoxLayout()
self.plot_layout = QGridLayout()
self.plot_layout.setMargin(0)
self.plot_scroll_widget = QWidget()
self.plot_scroll_area = QScrollArea()
self.plot_scroll_area.setFrameShape(QFrame.NoFrame)
self.plot_scroll_area.setWidgetResizable(True)
self.option_layout = QHBoxLayout()
self.plot_widget = None
if panels is not None:
for panel in panels:
self.add_panel(panel)
self.toolbar = QToolBar('Tools')
if not toolbar:
self.toolbar.hide()
# Configuring widget layout
self._setup_widget_properties(wintitle=wintitle, icon=icon)
self._setup_widget_layout()
# Options
self.option_callbacks = {}
self.legend = None
self.axis_syncplots = {}
示例9: __init__
def __init__(self):
QMainWindow.__init__(self)
self.setWindowTitle("iScope (TM)")
hlayout = QHBoxLayout()
central_widget = QWidget(self)
central_widget.setLayout(hlayout)
self.setCentralWidget(central_widget)
# ---guiqwt plot manager
self.manager = PlotManager(self)
示例10: synchronize_axis
def synchronize_axis(self, axis, plots=None):
if plots is None:
if axis in self.axis_syncplots:
plots = self.axis_syncplots[axis]
else:
plots = self.plots.keys()
if len(plots) < 1:
return
PlotManager.synchronize_axis(self, axis, plots)
# Find interval that needs to be shown in order to include all
# currently shown parts in the synchronized plots
plot_objects = [self.plots[p] for p in plots]
lb = min((p.axisScaleDiv(axis).lowerBound() for p in plot_objects))
ub = max((p.axisScaleDiv(axis).upperBound() for p in plot_objects))
for p in plot_objects:
p.setAxisScale(axis, lb, ub)
p.replot()
示例11: __init__
def __init__(self):
QMainWindow.__init__(self)
self.setWindowTitle("Signal filtering 2 (guiqwt)")
self.setWindowIcon(get_icon('guiqwt.svg'))
hlayout = QHBoxLayout()
central_widget = QWidget(self)
central_widget.setLayout(hlayout)
self.setCentralWidget(central_widget)
#---guiqwt plot manager
self.manager = PlotManager(self)
示例12: _setup_plot
def _setup_plot(self):
self.pm = PlotManager(self)
self.pm.add_plot(self.plot)
t = self.pm.add_tool(RtSelectionTool)
t.activate()
self.pm.set_default_tool(t)
self._setup_cursor()
self._setup_range_selector()
self._setup_label()
self._setup_axes()
示例13: configure_plot
def configure_plot(self):
self.marker = add_marker(self.plot)
self.line = MeasurementLine()
self.line.setVisible(0)
self.label = make_label(self.marker, self.line)
setupCommonStyle(self.line, self.marker)
manager = PlotManager(self.widget)
manager.add_plot(self.plot)
tool = manager.add_tool(MzSelectionTool)
tool.activate()
manager.set_default_tool(tool)
self.plot.add_item(self.marker)
self.plot.add_item(self.label)
self.plot.add_item(self.line)
self.plot.startMeasuring.connect(self.line.start_measuring)
self.plot.moveMeasuring.connect(self.line.move_measuring)
self.plot.stopMeasuring.connect(self.line.stop_measuring)
self.plot.moveMarker.connect(self.marker.move_local_point_to)
self.line.updated.connect(self.plot.replot)
示例14: CentralWidget
class CentralWidget(QWidget):
def __init__(self, parent):
QWidget.__init__(self, parent)
layout = QGridLayout()
self.setLayout(layout)
self.plot1 = ImagePlot(self)
layout.addWidget(self.plot1, 0, 0, 1, 1)
self.plot2 = ImagePlot(self)
layout.addWidget(self.plot2, 1, 0, 1, 1)
self.contrast = ContrastAdjustment(self)
layout.addWidget(self.contrast, 2, 0, 1, 2)
self.itemlist = PlotItemList(self)
layout.addWidget(self.itemlist, 0, 1, 2, 1)
self.manager = PlotManager(self)
for plot in (self.plot1, self.plot2):
self.manager.add_plot(plot)
for panel in (self.itemlist, self.contrast):
self.manager.add_panel(panel)
def register_tools(self):
self.manager.register_all_image_tools()
示例15: iScope
class iScope(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
self.setWindowTitle("iScope (TM)")
hlayout = QHBoxLayout()
central_widget = QWidget(self)
central_widget.setLayout(hlayout)
self.setCentralWidget(central_widget)
# ---guiqwt plot manager
self.manager = PlotManager(self)
# ---
def add_plot(self, x, y):
widget = iScopeWidget(self, x, y)
widget.setup_widget()
self.centralWidget().layout().addWidget(widget)
# ---Register plot to manager
self.manager.add_plot(widget.plot)
# ---
def setup_window(self):
# ---Add toolbar and register manager tools
toolbar = self.addToolBar("tools")
self.manager.add_toolbar(toolbar, id(toolbar))
self.manager.register_standard_tools()
self.manager.tools[0].activate()