本文整理汇总了Python中matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python NavigationToolbar2QTAgg.__init__方法的具体用法?Python NavigationToolbar2QTAgg.__init__怎么用?Python NavigationToolbar2QTAgg.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg
的用法示例。
在下文中一共展示了NavigationToolbar2QTAgg.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg import __init__ [as 别名]
def __init__(self, widgimage, parent=None):
#print 'ImgSpeNavToolBar.__init__'
self.widgimage = widgimage
self.canvas = self.widgimage.getCanvas()
fig = self.canvas.figure
fig.ntbZoomIsOn = False
NavigationToolbar.__init__( self, self.canvas, parent )
示例2: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg import __init__ [as 别名]
def __init__(self, canvas, parent, browser):
NavigationToolbar2QTAgg.__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'):
c.defaultAction().setVisible(False)
self.parent = parent
self.browser = browser
示例3: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg import __init__ [as 别名]
def __init__(self,canvas,parent):
#NavigationToolbar.__init__(self,parent,canevas)
#self.layout = QVBoxLayout( self )
self.canvas = canvas
#QtGui.QWidget.__init__(self, parent)
#self.layout.setMargin( 2 )
#self.layout.setSpacing( 0 )
NavigationToolbar.__init__(self, canvas, canvas)
示例4: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg import __init__ [as 别名]
def __init__(self, *args, **kwargs):
NavigationToolbar2QTAgg.__init__(self, *args, **kwargs)
self.init_buttons()
self.panAction.setCheckable(True)
self.zoomAction.setCheckable(True)
# remove the subplots action
self.removeAction( self.subplotsAction )
示例5: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg import __init__ [as 别名]
def __init__(self, parent, canvas):
""" Initialization
"""
NavigationToolbar2.__init__(self, canvas, canvas)
self._myParent = parent
self._navigationMode = MyNavigationToolbar.NAVIGATION_MODE_NONE
return
示例6: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg 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
示例7: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg import __init__ [as 别名]
def __init__(self, canvas, win):
NavigationToolbar.__init__(self, canvas, win)
self.win = win
path = os.path.abspath(__file__)
dir_path = os.path.dirname(path)
imagedir = os.path.join(dir_path,'images')
for text, tooltip_text, image_file, callback in self.mytoolitems:
if text is None:
self.addSeparator()
else:
a = self.addAction(QtGui.QIcon(os.path.join(imagedir, image_file + ".png")),
text, getattr(self, callback))
self._actions[callback] = a
if callback in ['zoom', 'pan']:
a.setCheckable(True)
if tooltip_text is not None:
a.setToolTip(tooltip_text)
示例8: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg import __init__ [as 别名]
def __init__(self, canvas, parent):
Navigationtoolbar.__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
if str(c.text()) in ('Pan','Zoom'):
self.clearButtons.append(c)
next = None
示例9: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg import __init__ [as 别名]
def __init__(self, parent, canvas, **params):
self.params = Params(**params)
# create the default toolbar
NavigationToolbar.__init__(self, canvas, parent)
self.canvas = canvas
self.data_accessor = self.params.data_accessor # alias
# add new toolbar buttons
normal_plot_action = self.__createAction__(title="Normal plot",
handler=self.__normalPlot__,
iconId='graph_button')
self.addAction(normal_plot_action)
scatter_plot_action = self.__createAction__(title="Scatter plot",
handler=self.__scatterPlot__,
iconId='scatter_plot_button')
self.addAction(scatter_plot_action)
histogram_plot_action = self.__createAction__(title="Histogram plot",
handler=self.__histogramPlot__,
iconId='histogram_plot_button')
self.addAction(histogram_plot_action)
tachogram_plot_settings_action = self.__createAction__(
title="Tachogram plot settings",
handler=self.__showTachogramPlotSettings__,
iconId='tachogram_plot_settings')
self.addAction(tachogram_plot_settings_action)
tachogram_plot_statistics_action = self.__createAction__(
title="Tachogram plot statistics",
handler=self.__showTachogramPlotStatistics__,
iconId='tachogram_plot_statistics')
self.addAction(tachogram_plot_statistics_action)
data_vector_preview_action = self.__createAction__(
title="Data preview",
handler=self.__showDataVectorPreview__,
iconId='data_vector_preview')
self.addAction(data_vector_preview_action)
示例10: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg import __init__ [as 别名]
def __init__(self, canvas, parent=None):
NavigationToolbar2QTAgg.__init__(self, canvas, parent, False)
self.parent = parent
self.ev_time = 0
self._xypress = []
#quick function to return icon locs
icon = lambda l: resfile('aston/qtgui', 'icons/' + l + '.png')
#remove the plot adjustment buttons
self.removeAction(self.actions()[-1])
self.removeAction(self.actions()[-1])
self.removeAction(self.actions()[-1])
#add the alignment tool
if not hasattr(self, '_actions'):
self._actions = {}
self._actions['align'] = QtGui.QAction(QtGui.QIcon(icon('align')), \
self.parent.tr('Align Chromatogram'), self)
self._actions['align'].setCheckable(True)
self.addAction(self._actions['align'])
self._actions['align'].triggered.connect(self.align)
self.addSeparator()
#add the peak tool
self._actions['peak'] = QtGui.QAction(QtGui.QIcon(icon('peak')), \
self.parent.tr('Add/Delete Peak'), self)
self._actions['peak'].setCheckable(True)
self.addAction(self._actions['peak'])
self._actions['peak'].triggered.connect(self.peak)
#add the spectra tool
self._actions['spectrum'] = QtGui.QAction( \
QtGui.QIcon(icon('spectrum')), self.parent.tr('Get Spectrum'), self)
self._actions['spectrum'].setCheckable(True)
self.addAction(self._actions['spectrum'])
self._actions['spectrum'].triggered.connect(self.spec)
示例11: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg import __init__ [as 别名]
def __init__(self, show_coords, update_sliders, canvas):
NavigationToolbar2QTAgg.__init__(self, canvas, None)
self.show_coords = show_coords
self.update_sliders = update_sliders
self.zoom()
示例12: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg import __init__ [as 别名]
def __init__(self, corner_callback, canvas):
NavigationToolbar2QTAgg.__init__(self, canvas, None)
self._corner_callback = corner_callback
self.zoom()
示例13: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg import __init__ [as 别名]
def __init__(self, plotCanvas, parent):
NavigationToolbar.__init__(self, plotCanvas, parent)
示例14: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg import __init__ [as 别名]
def __init__(self, canvas, parent ):
NavigationToolbar.__init__(self,canvas,parent)
for c in self.findChildren(QToolButton):
if str(c.text()) in ('Subplots','Customize','Forward','Back'):
c.defaultAction().setVisible(False)
continue
示例15: __init__
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QTAgg import __init__ [as 别名]
def __init__(self, canvases, tabs, parent=None):
self.canvases = canvases
self.tabs = tabs
NavigationToolbar.__init__(self, canvases[0], parent)