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


Python NavigationToolbar2QT.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QT import __init__ [as 别名]
 def __init__(self, plotCanvas, parent, custom_actions=True):
     """
     **Properties**
     
         *_firstChange* (boolean):
             Whether or not the y limits of the plots were
             changed before.
         *_plot_params* (dictionary):
             The plot parameters given as (key, value) pare.
     
     """
     NavigationToolbar2QTAgg.__init__(self, plotCanvas, parent)
     
     # properties {
     self._firstChange = True
     self._plot_params = {}
     # }
     
     # custom actions {
     if custom_actions:
         self.addSeparator()
         self.action_reset = self.addAction("Reset", self.onReset)
         self.action_reset.setToolTip("Reset the y limits")
         self.action_plus = self.addAction("+", self.onPlus)
         self.action_plus.setToolTip("Expand the y limits")
         self.action_minus = self.addAction("-", self.onMinus)
         self.action_minus.setToolTip("Reduce the y limits")
开发者ID:INM-6,项目名称:swan,代码行数:29,代码来源:matplotlibwidget.py

示例2: __init__

# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QT import __init__ [as 别名]
 def __init__(self, canvas, window, profile=True):
     self.toolitems = list(self.toolitems)
     self.toolitems.insert(6, ('Profile', 'Get the profile of a line in an image', 
         os.path.join(imgutils.RESSOURCE_PATH, "profile"), 'profile'))
     self.toolitems.insert(7, ('Stats', 'Get statistics on a portion of an image/line', 
         os.path.join(imgutils.RESSOURCE_PATH, "stats"), 'stats'))
     NavigationToolbar.__init__(self, canvas, window)
     self._actions['profile'].setCheckable(True)
     self._actions['stats'].setCheckable(True)
开发者ID:flomertens,项目名称:libwise,代码行数:11,代码来源:plotutils_ui.py

示例3: __init__

# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QT import __init__ [as 别名]
 def __init__(self, canvas, parent, browser):
     NavigationToolbar2QT.__init__(self,canvas,parent)
     for c in self.findChildren(QtGui.QToolButton):
         #print str(c.text())
         #if str(c.text()) in ('Subplots','Customize','Back','Forward','Home'):
         if str(c.text()) in ('Customize','Back','Forward'):
             c.defaultAction().setVisible(False)
     self.parent = parent
     self.browser = browser
开发者ID:ineuron,项目名称:NeuroDAQ-Analysis,代码行数:11,代码来源:MplWidgets.py

示例4: __init__

# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QT import __init__ [as 别名]
    def __init__(self, canvas, parent, coordinates=True):
        NavigationToolbar2QT.__init__(self, canvas, parent, coordinates)
        self.setIconSize(QtCore.QSize(16, 16))

        self.ct = None
        self.mw = None
        self._idPress1 = None
        self._idPress2 = None
        self._idPress3 = None
开发者ID:Pengchengu,项目名称:herding-spikes,代码行数:11,代码来源:customtoolbarpca.py

示例5: __init__

# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QT import __init__ [as 别名]
    def __init__(self, parent, canvas):
        """ Initialization
        """
        NavigationToolbar2.__init__(self, canvas, canvas)

        self._myParent = parent
        self._navigationMode = MyNavigationToolbar.NAVIGATION_MODE_NONE

        return
开发者ID:mducle,项目名称:mantid,代码行数:11,代码来源:mpl2dgraphicsview.py

示例6: __init__

# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QT import __init__ [as 别名]
 def __init__(self , parent , canvas , orientation = Qt.Vertical,
                         close_button = False) :
     """
     A simple matplotlib navigation toolbar that can be vertical
     Qt.Vertical or Qt.Horizontal
     """
     NavigationToolbar2.__init__( self, canvas,parent )
     self.setOrientation(orientation)
     if close_button:
         self.addSeparator()
         self.actionClose = self.addAction(QIcon(':/window-close.png'), 'Close')
开发者ID:AntoineValera,项目名称:SynaptiQs,代码行数:13,代码来源:enhancedmatplotlib.py

示例7: __init__

# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QT import __init__ [as 别名]
	def __init__(self, canvas, parent ):
		NavigationToolbar2QT.__init__(self,canvas,parent)
		self.clearButtons=[]
		# Search through existing buttons
		# next use for placement of custom button
		next=None
		for c in self.findChildren(QToolButton):
			if next is None:
				next=c
			# Don't want to see subplots and customize
			if str(c.text()) in ('Subplots','Customize','Forward', 'Back'):
				c.defaultAction().setVisible(False)
				continue
开发者ID:forstater,项目名称:mosaic,代码行数:15,代码来源:mplwidget.py

示例8: __init__

# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QT import __init__ [as 别名]
    def __init__(self, canvas_, parent_):
        override.figureoptions = None  # Monkey patched to kill the figure options button on matplotlib toolbar

        self.toolitems = (
            ('Home', 'Reset original view', 'home', 'home'),
            ('Save', 'Save the current image', 'filesave', 'save_figure'),
            (None, None, None, None),
            ('Back', 'Back to previous view', 'back', 'back'),
            ('Forward', 'Forward to next view', 'forward', 'forward'),
            (None, None, None, None),
            ('Pan', 'Pan axes with left mouse, zoom with right', 'move', 'pan'),
            ('Zoom', 'Zoom to rectangle', 'zoom_to_rect', 'zoom'),
        )
        NavigationToolbar2QT.__init__(self, canvas_, parent_)
开发者ID:Unidata,项目名称:Wave,代码行数:16,代码来源:mainwindow.py

示例9: __init__

# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QT import __init__ [as 别名]
    def __init__(self, canvas, parent ):
        
        NavigationToolbar2QT.__init__(self,canvas,parent)
        self.clearButtons=[]
        # Search through existing buttons
        # next use for placement of custom button
        next=None
        for c in self.findChildren(QtGui.QToolButton):
            if next is None:
                next=c
            # Don't want to see subplots and customize
            """
            if str(c.text()) in ('Subplots', 'Customize'):
                c.defaultAction().setVisible(False)
                continue
            """
            # Need to keep track of pan and zoom buttons
            # Also grab toggled event to clear checked status of picker button
            if str(c.text()) in ('Pan','Zoom'):
                c.toggled.connect(self.clearCurs)
                self.clearButtons.append(c)
                next=None

        # create custom button
        pm=QtGui.QPixmap(32,32)
        pm.fill(QtGui.QApplication.palette().color(QtGui.QPalette.Normal,QtGui.QPalette.Button))
        painter=QtGui.QPainter(pm)
        painter.fillRect(6,6,20,20,QtCore.Qt.red)
        painter.fillRect(15,3,3,26,QtCore.Qt.blue)
        painter.fillRect(3,15,26,3,QtCore.Qt.blue)
        painter.end()
        icon=QtGui.QIcon(pm)
        
        ac = self.addAction(icon, "Toggle Curs") 
        ac.setCheckable(True) 
        ac.toggled.connect(self.curs_toggle)        
        
        self.ac = ac
        
        #button=QtGui.QToolButton(self)
        #button.setDefaultAction(self.ac)

        # Add it to the toolbar, and connect up event
        #self.insertWidget(next.defaultAction(),button)

        # Grab the picked event from the canvas
        canvas.mpl_connect('pick_event',self.canvasPicked)
开发者ID:Morisset,项目名称:pySSN,代码行数:49,代码来源:pyssn_qt.py

示例10: __init__

# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QT import __init__ [as 别名]
 def __init__(self,canvas_,parentframe_,parclass):
     self.parclass = parclass
     # images: Python34\Lib\site-packages\matplotlib\mpl-data\images
     self.toolitems = (
         ('Home', 'original scale', 'home', 'home'),
         #('Back', 'consectetuer adipiscing elit', 'back', 'back'),
         #('Forward', 'sed diam nonummy nibh euismod', 'forward', 'forward'),
         (None, None, None, None),
         ('Pan', 'pan', 'move', 'pan'),
         (None, None, None, None),
         ('Zoom', 'zoom', 'zoom_to_rect', 'zoom'),
         (None, None, None, None),
         (None, None, None, None),
         ('Cursor','Cursor','cursor','onCursor'),
         (None, None, None, None),
         )
     NavigationToolbar.__init__(self,canvas_,parentframe_,False)
开发者ID:HenricusRex,项目名称:TMV3,代码行数:19,代码来源:GraphViewer.py

示例11: __init__

# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QT import __init__ [as 别名]
    def __init__(self, parent, canvas):
        """ Initialization
        FUTURE: direction='h'
        """
        self.canvas = canvas
        QtGui.QWidget.__init__(self, parent)

        #if direction=='h' :
        #    self.layout = QtGui.QHBoxLayout(self)
        #else :
        #    self.layout = QtGui.QVBoxLayout(self)

        #self.layout.setMargin(2)
        #self.layout.setSpacing(0)

        NavigationToolbar.__init__( self, canvas, canvas )

        return
开发者ID:DanNixon,项目名称:mantid,代码行数:20,代码来源:MplFigureCanvas.py

示例12: __init__

# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QT import __init__ [as 别名]
    def __init__(self,canvas,parent,figure,remove=[]):
        self.canvas = canvas
        self.figure = figure
        self.span = {}
        self.toolitems = (
            ('Home', 'Reset original view', 'home', 'home'),
            ('Back', 'Back to  previous view', 'back', 'back'),
            ('Forward', 'Forward to next view', 'forward', 'forward'),
            (None, None, None, None),
            ('Pan', 'Pan axes with left mouse, zoom with right', 'move', 'pan'),
            ('Zoom', 'Zoom to rectangle', 'zoom_to_rect', 'zoom'),
            (None, None, None, None),
            ('Subplots', 'Configure subplots', 'subplots', 'configure_subplots'),
            ('Save', 'Save the figure', 'filesave', 'save_figure'),
            ('Csv Save', 'Save data to CSV File', '', 'csv_save'),
            ('Legend', 'Toggle legend', '', 'legend_switch'),
            ('Hold', 'Hold graph', '', 'hold_figure'),
            ('Cut', 'Cut figure', '', 'cut_figure'),
            
            )
        NavigationToolbar2QT.__init__(self,canvas,parent)
        actions = self.findChildren(QtGui.QAction)
        self._actions["csv_save"].setIcon(QtGui.QIcon("images/CSV.png"))
        self._actions["legend_switch"].setIcon(QtGui.QIcon("images/legend.png"))
        self._actions["hold_figure"].setIcon(QtGui.QIcon("images/toggle.png"))
        self._actions["cut_figure"].setIcon(QtGui.QIcon("images/Cut.png"))
        self._actions["cut_figure"].setCheckable(1)
        self._actions["legend_switch"].setCheckable(1)
        self._actions["hold_figure"].setCheckable(1)
        for a in actions:
            if a.text() == 'Customize':
                self.removeAction(a)
                break

        for i in remove:
            self._actions[i].hide()
        self._actions["hold_figure"].setChecked(config["hold_graph_on_start"])
开发者ID:NiPKIT,项目名称:PyLAS,代码行数:39,代码来源:NavigationToolBar.py

示例13: __init__

# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QT import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     NavigationToolbar.__init__(self, *args, **kwargs)
开发者ID:josef-dunbar,项目名称:pyFDA,代码行数:4,代码来源:plot_utils.py

示例14: __init__

# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QT import __init__ [as 别名]
 def __init__(self, canvas, parent, tools=('Home', 'Pan', 'Zoom', 'Save'), **kwargs):
     matplotlib.backends.backend_qt4.figureoptions = None
     matplotlib.backends.backend_qt5.figureoptions = None
     self.toolitems = [t for t in NavigationToolbar2QT.toolitems if t[0] in tools]
     NavigationToolbar2QT.__init__(self, canvas, parent, **kwargs)
开发者ID:mrkwjc,项目名称:ffnetui,代码行数:7,代码来源:mplqt.py


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