本文整理汇总了Python中matplotlib.backends.backend_qt4.NavigationToolbar2QT.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python NavigationToolbar2QT.__init__方法的具体用法?Python NavigationToolbar2QT.__init__怎么用?Python NavigationToolbar2QT.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backends.backend_qt4.NavigationToolbar2QT
的用法示例。
在下文中一共展示了NavigationToolbar2QT.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4 import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4.NavigationToolbar2QT import __init__ [as 别名]
def __init__(self, canvas, frame, name=None):
""" Create a new toolbar object
Parameters
----------
data_collection : DataCollection instance
The data collection that this toolbar is meant to edit.
The toolbar looks to this collection for the available subsets
to manipulate.
canvas : Maptloblib canvas instance
The drawing canvas to interact with
frame : QWidget
The QT frame that the canvas is embedded within.
"""
self.buttons = {}
self.__active = None
self.basedir = None
NavigationToolbar2QT.__init__(self, canvas, frame)
if name is not None:
self.setWindowTitle(name)
self.setIconSize(QtCore.QSize(25, 25))
self.layout().setSpacing(1)
self.setFocusPolicy(Qt.StrongFocus)
self._idKey = None
# pyside is prone to segfaults if slots hold the only
# reference to a signal, so we hold an extra reference
# see https://bugreports.qt-project.org/browse/PYSIDE-88
self.__signals = []
示例2: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4 import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4.NavigationToolbar2QT import __init__ [as 别名]
def __init__(self , canvas , parent , direction = 'h' ) :
#NavigationToolbar.__init__(self,parent,canvas)
#self.layout = QVBoxLayout( self )
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, parent )
示例3: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4 import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4.NavigationToolbar2QT import __init__ [as 别名]
def __init__(self, canvas, parent, coordinates=True):
"""
Constructor of NavToolBar
:param canvas: the matplotlib canvas
:type canvas: matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg
:param parent: the parent QWidget
:type parent: PyQt4.QtGui.QWidget
:param coordinates: boolean coordinates
:type coordinates: bool
"""
NavigationToolbar2QT.__init__(self, canvas, parent, coordinates)
self.setIconSize(QSize(16, 16))
示例4: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4 import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4.NavigationToolbar2QT import __init__ [as 别名]
def __init__(self, canvas, frame, name=None):
""" Create a new toolbar object
Parameters
----------
data_collection : DataCollection instance
The data collection that this toolbar is meant to edit.
The toolbar looks to this collection for the available subsets
to manipulate.
canvas : Maptloblib canvas instance
The drawing canvas to interact with
frame : QWidget
The QT frame that the canvas is embedded within.
"""
self.buttons = {}
self.basedir = None
NavigationToolbar2QT.__init__(self, canvas, frame)
if name is not None:
self.setWindowTitle(name)
self.setIconSize(QtCore.QSize(25, 25))
self.layout().setSpacing(1)
self.setFocusPolicy(Qt.StrongFocus)
示例5: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4 import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4.NavigationToolbar2QT import __init__ [as 别名]
def __init__(self, canvas, parent, coordinates=False):
NavigationToolbar2QT.__init__(self, canvas, parent, coordinates)
self.setIconSize(QtCore.QSize(20, 20)) # to change size of icons in toolbar