当前位置: 首页>>代码示例>>Python>>正文


Python PlotManager.add_toolbar方法代码示例

本文整理汇总了Python中guiqwt.plot.PlotManager.add_toolbar方法的典型用法代码示例。如果您正苦于以下问题:Python PlotManager.add_toolbar方法的具体用法?Python PlotManager.add_toolbar怎么用?Python PlotManager.add_toolbar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在guiqwt.plot.PlotManager的用法示例。


在下文中一共展示了PlotManager.add_toolbar方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: TestWindow

# 需要导入模块: from guiqwt.plot import PlotManager [as 别名]
# 或者: from guiqwt.plot.PlotManager import add_toolbar [as 别名]
class TestWindow(QMainWindow):
    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)
        #---
        
    def add_plot(self, x, y, func, title):
        widget = FilterTestWidget(self, x, y, func)
        widget.setup_widget(title)
        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_all_curve_tools()
开发者ID:CaptainAL,项目名称:Spyder,代码行数:29,代码来源:filtertest2.py

示例2: iScope

# 需要导入模块: from guiqwt.plot import PlotManager [as 别名]
# 或者: from guiqwt.plot.PlotManager import add_toolbar [as 别名]
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()
开发者ID:jwerdec,项目名称:beamerlib,代码行数:29,代码来源:angular_distr.py

示例3: Window

# 需要导入模块: from guiqwt.plot import PlotManager [as 别名]
# 或者: from guiqwt.plot.PlotManager import add_toolbar [as 别名]
class Window(QMainWindow):
    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'))

    def closeEvent(self, event):
        global _figures, _current_fig, _current_axes
        figure_title = to_text_string(self.windowTitle())
        if _figures.pop(figure_title) == _current_fig:
            _current_fig = None
            _current_axes = None
        self.itemlist.close()
        self.contrast.close()
        self.xcsw.close()
        self.ycsw.close()
        event.accept()
        
    def add_plot(self, i, j, plot):
        self.layout.addWidget(plot, i, j)
        self.manager.add_plot(plot)
        self.plots.append(plot)

    def replot(self):
        for plot in self.plots:
            plot.replot()
            item = plot.get_default_item()
            if item is not None:
                plot.set_active_item(item)
                item.unselect()
            
    def add_panels(self, images=False):
        self.manager.add_panel(self.itemlist)
        if images:
            for panel in (self.ycsw, self.xcsw, self.contrast):
                panel.hide()
                self.manager.add_panel(panel)
            
    def register_tools(self, images=False):
        if images:
            self.manager.register_all_image_tools()
        else:
            self.manager.register_all_curve_tools()
    
    def display(self):
        self.show()
        self.replot()
        self.manager.get_default_tool().activate()
        self.manager.update_tools_status()
开发者ID:stonebig,项目名称:guiqwt-1,代码行数:73,代码来源:pyplot.py

示例4: GuiQwtPlot

# 需要导入模块: from guiqwt.plot import PlotManager [as 别名]
# 或者: from guiqwt.plot.PlotManager import add_toolbar [as 别名]

#.........这里部分代码省略.........

        w = QtGui.QWidget()
        w.setLayout( hbox )

        self.setCentralWidget( w )

    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' )
                
    def fill_series_list(self, names):
        self.series_list_model.clear()
        
        counterlist = 0
        for name in reversed(names):
            item = QtGui.QStandardItem(name)
#            if counterlist == 0: # Check only the first one
#                item.setCheckState(Qt.Checked)
#            else:
            item.setCheckState(Qt.Unchecked)
            item.setCheckable(True)
            self.series_list_model.appendRow(item)
            counterlist = counterlist + 1

# Load data to the list
    def button_Click( self ):
        # Find the newest files in the directory and subdirectories
        # and populate the list of files
        self.y = {}
        self.x = {}
        self.timestamp = {}
        self.names = []
        self.fullfilename = {}
开发者ID:uvainio,项目名称:chiplotter,代码行数:69,代码来源:chiplotter.py

示例5: MainWindow

# 需要导入模块: from guiqwt.plot import PlotManager [as 别名]
# 或者: from guiqwt.plot.PlotManager import add_toolbar [as 别名]

#.........这里部分代码省略.........
        # but not compatible with graphical user interface creation.
        # For example, if you need to plot data with Matplotlib, you will need 
        # to pass the option: multithreaded=False
        self.console = cons = InternalShell(self, namespace=ns, message=msg)
        
        # Setup the console widget
        cons.set_font(font)
        cons.set_codecompletion_auto(True)
        cons.set_calltips(True)
        cons.setup_calltips(size=600, font=font)
        cons.setup_completion(size=(300, 100), font=font)
        console_dock = qg.QDockWidget("Console", self)
        console_dock.setWidget(cons)
        
        # Add the console widget to window as a dockwidget
        self.addDockWidget(qc.Qt.BottomDockWidgetArea, console_dock)
        
            
    def add_plot(self, title):
        """
        """
        self.widget = PlotWidget(self)
        self.widget.setup_widget(title)
        self.centralWidget().layout().addWidget(self.widget)
        
        #---Register plot to manager    
        self.manager.add_plot(self.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_all_curve_tools()
        
    def closeEvent(self, event):
        """
        """
        self.console.exit_interpreter()
        event.accept()       

    def findOpenDBases(self):
        """
        """
        return self.widget.databaseScroll.DataBasesOpen
        
    ### popup actions: 
        
    def add_newData(self):
        """
        """
        DBname = Popup(self.findOpenDBases(), 
                       textMessage = "add data to a database:",
                       style = 4)
                       
        if DBname.selection != None and DBname.selection != []:
            
            name = DBname.selection[1]
            neuronName = DBname.selection[2]
            if self.widget.databaseScroll.isOpen(name):
                addData = Dbase(DBaseName = name)
                if not addData.Data.Exists(neuronName):
                    addData.AddData(neuronName, Directory = DBname.selection[0])
                
                    self.widget.databaseScroll.refreshTree()
开发者ID:bps10,项目名称:Database,代码行数:70,代码来源:mainWindow.py

示例6: plotWindow

# 需要导入模块: from guiqwt.plot import PlotManager [as 别名]
# 或者: from guiqwt.plot.PlotManager import add_toolbar [as 别名]
class plotWindow(QMainWindow):
	def __init__(self, *args, **kwargs):
		QMainWindow.__init__(self, *args, **kwargs)
		
		self.__initVars()
		
		# init self
		geo = self.geometry()
		geo.setWidth(800)
		geo.setHeight(600)
		geo.setX(100)
		geo.setY(100)
		self.setGeometry(geo)
		
		self.setWindowTitle("plot window")
		
		self.__initLayout()
	# end __init__
	
	def __del__(self):
		if (self.__p_manager):
			del self.__p_manager
		# end if
		
		self.__initVars()
	# end __del__
	
	def __initVars(self):
		self.__p_manager = False
		self.__p_toolbar = False
		self.__p_resizeButton = False
		self.__l_layoutChilds = []
		self.__v_wasInitialized = False
	# end __initVars
	
	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
	# end __initManager
	
	def reInit(self):
		for plot in self.__l_layoutChilds:
			self.centralWidget().layout().removeWidget(plot)
			del plot
		# end if
		self.__l_layoutChilds = []
		
		# layout
		oldLayout = self.centralWidget().layout()
		del oldLayout

		if (self.__p_manager):
			del self.__p_manager
			self.__p_manager = False
		# end if
		
		self.__initLayout()
	# end reInit
	
	def addCurvePlot(self, curves, *args, **kwargs):
		return self.__addPlot(curves, noneBugCurvePlot, *args, **kwargs)
	# end addCurvePlot
	
	def addImagePlot(self, images, *args, **kwargs):
		return self.__addPlot(images, ImagePlot, *args, **kwargs)
	# end addImagePlot
	
	def addImageWidget(self, images, *args, **kwargs):
		widget = ImageWidget(self, *args, **kwargs)
		plot = widget.get_plot()
		
		if (images.__class__ is not list):
			plot.add_item(images)
		else:
			for image in images:
				plot.add_item(image)
#.........这里部分代码省略.........
开发者ID:pgollor,项目名称:pyGUI,代码行数:103,代码来源:plotEngine.py


注:本文中的guiqwt.plot.PlotManager.add_toolbar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。