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


Python PlotManager.register_all_curve_tools方法代码示例

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


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

示例1: TestWindow

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

# 需要导入模块: from guiqwt.plot import PlotManager [as 别名]
# 或者: from guiqwt.plot.PlotManager import register_all_curve_tools [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

示例3: MainWindow

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

#.........这里部分代码省略.........
        # 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()
                    print 'data import complete.'
开发者ID:bps10,项目名称:Database,代码行数:70,代码来源:mainWindow.py

示例4: GuiQwtPlot

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

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

        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 = {}

    # Clear the list in case used another directory before
        self.series_list_model.clear()
    # Go to the directory specified in the field or if none, give error message
开发者ID:uvainio,项目名称:chiplotter,代码行数:70,代码来源:chiplotter.py

示例5: plotWindow

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

#.........这里部分代码省略.........
	# 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)
			# end for
		# end if
		
		self.centralWidget().layout().addWidget(widget)
		
		self.__l_layoutChilds.append(widget)
		
		return widget
	# end addImageWidget
	
	def getManager(self):
		return self.__p_manager
	# end getManager
	
	def __addPlot(self, dataList, plotClass, *args, **kwargs):
		"""
		pos[0]: row
		pos[1]: column
		pos[2]: rowspan 
		pos[3]: columnspan
		"""
		pos = []
		if ('position' in kwargs):
			pos = kwargs.pop('position')
		# end if
		if ('pos' in kwargs):
			pos = kwargs.pop('pos')
		# end if

		plot = plotClass(self, *args, **kwargs)
		
		if (dataList.__class__ is not list):
			plot.add_item(dataList)
		else:
			for data in dataList:
				plot.add_item(data)
			# end for
		# end if
		
		self.__registerPlot(plot, pos)
		
		return plot
	# end __addPlot
	
	def __registerPlot(self, plot, pos):
		# check for position
		if (pos != []):
			if (len(pos) == 2):
				pos.append(1) # rowspan
				pos.append(1) # columnspan
			# end if

			self.centralWidget().layout().addWidget(plot, pos[0], pos[1], pos[2], pos[3])
		else:
			self.centralWidget().layout().addWidget(plot)
		# end if
		self.__l_layoutChilds.append(plot)

		self.__p_manager.add_plot(plot)
	# end __registerPLot
	
	def show(self, *args, **kwargs):
		if (self.__v_wasInitialized):
			self.__p_manager.register_all_curve_tools()
			self.__v_wasInitialized = False
		# end if
		
		QMainWindow.show(self, *args, **kwargs)
	# end show
	
	def showEvent(self, event):
		# emit signal	
		self.emit(SIGNAL("onShow()"))
		
		# execute not overloaded showEvent
		QMainWindow.showEvent(self, event)
	# end showEvent

	def closeEvent(self, event):
		# emit signal
		self.emit(SIGNAL("onClose()"))
		
		# execute not overloaded closeEvent
		QMainWindow.closeEvent(self, event)
	# end closeEvent
	
	def __onAutoScale(self):
		plot = self.__p_manager.get_active_plot()
		plot.do_autoscale(True)
开发者ID:pgollor,项目名称:pyGUI,代码行数:104,代码来源:plotEngine.py


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