• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python backend_qt4agg.NavigationToolbar2QTAgg类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: _init_toolbar

 def _init_toolbar(self):
     selectAction = self.addAction(QIcon(":/plugins/spatialplot/action.png"), 'Select Features', self.select_mode)
     selectAction.setToolTip('Click and drag the plot to select features in the QGIS interface.')
     selectAction.setCheckable(True)
     self._actions['select'] = selectAction
     
     NavigationToolbar2QTAgg._init_toolbar(self)
开发者ID:AuScope,项目名称:spatial-plot,代码行数:7,代码来源:interactivetoolbar.py


示例2: __init__

 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
开发者ID:de278,项目名称:NeuroDAQ-Analysis,代码行数:8,代码来源:MplWidgets.py


示例3: __init__

	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 )
开发者ID:luipir,项目名称:ps-speed,代码行数:9,代码来源:plot_wdg.py


示例4: MplCanvas

class MplCanvas(FigureCanvas):
    def __init__(self, parent=None, width=5, height=4, dpi=100):
        matplotlib.rcParams['font.size'] = 8
        self.figure = Figure(figsize=(width, height), dpi=dpi)
        self.axes = self.figure.add_subplot(111)

        FigureCanvas.__init__(self, self.figure)
        self.setParent(parent)
        
        self.toolbar = NavigationToolbar(self, parent)
        self.toolbar.setIconSize(QSize(16, 16))

        FigureCanvas.setSizePolicy(self,
                                   QSizePolicy.Expanding,
                                   QSizePolicy.Expanding)
        FigureCanvas.updateGeometry(self)
        
    def getToolbar(self):
        return self.toolbar

    def clear(self):
        self.figure.clear()
        self.axes = self.figure.add_subplot(111)
        
    def test(self):
        self.axes.plot([1,2,3,4])
        
    def saveAs(self, fname):
        self.figure.savefig(fname)
开发者ID:aroche,项目名称:MatplotlibGraph,代码行数:29,代码来源:mpl_canvas.py


示例5: plotwidget

class plotwidget(FigureCanvas):
    def __init__(self, parent, width=12, height=6, dpi=72, projection3d=False):

        #plotdata can be 2d array for image plot or list of 2 1d arrays for x-y plot or 2d array for image plot or list of lists of 2 1D arrays

        self.fig=Figure(figsize=(width, height), dpi=dpi)
        if projection3d:
            self.axes=self.fig.add_subplot(111, navigate=True, projection='3d')
        else:
            self.axes=self.fig.add_subplot(111, navigate=True)

        self.axes.hold(True)
        FigureCanvas.__init__(self, self.fig)
        self.setParent(parent)
        #self.parent=parent
        FigureCanvas.setSizePolicy(self, QSizePolicy.Expanding, QSizePolicy.Expanding)
        FigureCanvas.updateGeometry(self)
        #NavigationToolbar(self, parent)
        
        self.toolbar=NavigationToolbar(self.figure.canvas, self)
        self.toolbar.setMovable(True)#DOESNT DO ANYTHING
        self.mpl_connect('button_press_event', self.myclick)
        self.clicklist=[]

    def myclick(self, event):
        if not (event.xdata is None or event.ydata is None):
            arrayxy=[event.xdata, event.ydata]
            print 'clicked on image: array indeces ', arrayxy, ' using button', event.button
            self.clicklist+=[arrayxy]
            self.emit(SIGNAL("genericclickonplot"), [event.xdata, event.ydata, event.button])
开发者ID:helgestein,项目名称:PythonCompositionPlots,代码行数:30,代码来源:QuatPlotTypes_QtDemo.py


示例6: __init__

 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 )
开发者ID:FilipeMaia,项目名称:psdmrepo,代码行数:7,代码来源:ImgSpeNavToolBar.py


示例7: __init__

class MatplotlibPlot:
    """ Class encapsulating a matplotlib plot"""

    def __init__(self, parent = None, dpi = 100, size = (5,5)):
        """ Class initialiser """

        self.dpi = dpi
        self.figure = Figure(size, dpi = self.dpi)
        self.canvas = FigureCanvas(self.figure)
        self.canvas.setParent(parent)

        # Create the navigation toolbar, tied to the canvas
        self.toolbar = NavigationToolbar(self.canvas, parent)
        self.canvas.show()
        self.toolbar.show()

        # Reset the plot landscape
        self.figure.clear()

    def plotMultiPixel(self, info, data):
        """ Generate multi-pixel plot """

        # Tabula Rasa
        self.figure.clear()
        rows = math.ceil(math.sqrt(info['nbeams']))

	    # Display a subplot per beam (randomly for now)
        for i in range(info['nbeams']):
            ax = self.figure.add_subplot(rows, rows, i)
            ax.plot(data[:,512,i])
            
        

    def updatePlot(self):
        self.canvas.draw()
开发者ID:jintaoluo,项目名称:MDSM,代码行数:35,代码来源:multi_pixel.py


示例8: home

 def home(self, *args) :
     print 'Home is clicked'
     fig = self.canvas.figure
     fig.myXmin = None
     fig.myXmax = None
     fig.myYmin = None
     fig.myYmax = None
     NavigationToolbar.home(self)
开发者ID:FilipeMaia,项目名称:psdmrepo,代码行数:8,代码来源:MyNavigationToolbar.py


示例9: __init__

 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)
开发者ID:iancze,项目名称:Pysplotter,代码行数:8,代码来源:mplwidget.py


示例10: __init__

    def __init__(self, parent, canvas):
        """ Initialization
        """
        NavigationToolbar2.__init__(self, canvas, canvas)

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

        return
开发者ID:spaceyatom,项目名称:mantid,代码行数:9,代码来源:mplgraphicsview.py


示例11: MplWidgetT

class MplWidgetT(QtGui.QWidget):
    def __init__(self, parent = None):
        QtGui.QWidget.__init__(self, parent)
        self.canvas = MplCanvas()
        self.ntb = NavigationToolbar(self.canvas, self)
        self.ntb.setIconSize(QtCore.QSize(16, 16))
        self.vbl = QtGui.QVBoxLayout()
        self.vbl.addWidget(self.canvas)
        self.vbl.addWidget(self.ntb)
        self.setLayout(self.vbl)
开发者ID:Pengchengu,项目名称:herding-spikes,代码行数:10,代码来源:mplwidget.py


示例12: _update_view

    def _update_view(self):
        """
        view update called by home(), back() and forward()
        :return:
        """
        NavigationToolbar2._update_view(self)

        self._myParent.evt_view_updated()

        return
开发者ID:spaceyatom,项目名称:mantid,代码行数:10,代码来源:mplgraphicsview.py


示例13: draw

    def draw(self):
        """
        Canvas is drawn called by pan(), zoom()
        :return:
        """
        NavigationToolbar2.draw(self)

        self._myParent.evt_view_updated()

        return
开发者ID:spaceyatom,项目名称:mantid,代码行数:10,代码来源:mplgraphicsview.py


示例14: NewFigure_proc

 def NewFigure_proc(self):
     widget = QtGui.QWidget(self.MainFigTabWidget)
     vlay = QtGui.QVBoxLayout(widget)
     self.Figures.append(MplWidget(widget))
     ntb = NavToolbar(self.Figures[-1], parent = widget)
     ntb.setIconSize(QtCore.QSize(15,15))
     vlay.setSpacing(0)
     vlay.setMargin(0)
     vlay.addWidget(self.Figures[-1])
     vlay.addWidget(ntb)
     widget.setLayout(vlay)
     self.MainFigTabWidget.addTab(widget, 'Figure '+str(len(self.Figures)))
     widget.setObjectName(str(self.MainFigTabWidget.count()))
     self.Figures[-1].setObjectName(str(self.MainFigTabWidget.count()))
开发者ID:AScaglione,项目名称:pyNeuroExplorer,代码行数:14,代码来源:gui_NeuroExplorer.py


示例15: __init__

  def __init__(self, plugin, parent=None):
    QWidget.__init__(self, parent)
    self.setupUi(self)

    self.plugin = plugin
    self.inputs = plugin.inputs
    self.settings = QSettings("NextGIS", "MOLUSCE")

    # init plot for learning curve
    self.figure = Figure()
    self.axes = self.figure.add_subplot(111)
    self.figure.suptitle(self.tr("Neural Network learning curve"))
    self.canvas = FigureCanvas(self.figure)
    self.mpltoolbar = NavigationToolbar(self.canvas, None)
    lstActions = self.mpltoolbar.actions()
    self.mpltoolbar.removeAction(lstActions[7])
    self.layoutPlot.addWidget(self.canvas)
    self.layoutPlot.addWidget(self.mpltoolbar)

    # and configure matplotlib params
    rcParams['font.serif'] = "Verdana, Arial, Liberation Serif"
    rcParams['font.sans-serif'] = "Tahoma, Arial, Liberation Sans"
    rcParams['font.cursive'] = "Courier New, Arial, Liberation Sans"
    rcParams['font.fantasy'] = "Comic Sans MS, Arial, Liberation Sans"
    rcParams['font.monospace'] = "Courier New, Liberation Mono"

    self.btnTrainNetwork.clicked.connect(self.trainNetwork)

    self.manageGui()
开发者ID:stupidrabbit,项目名称:molusce,代码行数:29,代码来源:neuralnetworkwidget.py


示例16: _createPlotWidget

 def _createPlotWidget(self):
     self._plotWidget = QtGui.QWidget()
     self._plotFigure = Figure()
     self._plotCanvas = FigureCanvas(self._plotFigure)
     self._plotCanvas.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
     self._plotCanvas.updateGeometry()
     self._plotCanvas.setParent(self._plotWidget)
     self._plotCanvas.mpl_connect('scroll_event', self._onScroll)
     self._plotFigure.set_canvas(self._plotCanvas)
     # Vm and command voltage go in the same subplot
     self._vm_axes = self._plotFigure.add_subplot(2,2,1, title='Membrane potential')
     self._vm_axes.set_ylim(-20.0, 120.0)
     # Channel conductances go to the same subplot
     self._g_axes = self._plotFigure.add_subplot(2,2,2, title='Channel conductance')
     self._g_axes.set_ylim(0.0, 0.5)
     # Injection current for Vclamp/Iclamp go to the same subplot
     self._im_axes = self._plotFigure.add_subplot(2,2,3, title='Injection current')
     self._im_axes.set_ylim(-0.5, 0.5)
     # Channel currents go to the same subplot
     self._i_axes = self._plotFigure.add_subplot(2,2,4, title='Channel current')
     self._i_axes.set_ylim(-10, 10)
     for axis in self._plotFigure.axes:
         axis.set_autoscale_on(False)
     layout = QtGui.QVBoxLayout()
     layout.addWidget(self._plotCanvas)
     self._plotNavigator = NavigationToolbar(self._plotCanvas, self._plotWidget)
     layout.addWidget(self._plotNavigator)
     self._plotWidget.setLayout(layout)
开发者ID:NeuroArchive,项目名称:moose,代码行数:28,代码来源:squid_demo.py


示例17: __init__

   def __init__(self, parent, corrmatrix):
     QFrame.__init__(self)
    
     self.setWindowTitle("Correlation Matrix")
     
     self.corrmatrix=[[]]
     self.rank=None
     self.rim=0.05
  
     self.parent=parent            # parent object/class
     self.fig=None
  
     # Create canvas for plotting
     self.fig = Figure((7, 7), dpi=100)
     self.canvas = FigureCanvas(self.fig)
     self.canvas.setParent(self)
     self.fig.subplots_adjust(left=self.rim, right=1.0-self.rim, top=1.0-self.rim, bottom=self.rim)  # set a small rim
     self.ax=self.fig.add_subplot(111)

     self.mpl_toolbar = NavigationToolbar(self.canvas, self)
     self.mpl_toolbar.show()
  
     self.setMinimumWidth(700)
     self.setMinimumHeight(700)
     self.corrmatrix=corrmatrix

     self.xLabel="Parameter index"
     self.yLabel="Parameter index"

     self.createWidgets()
     self.createLayouts()
     self.connectSignals()
     self.plot(self.corrmatrix)
开发者ID:jjdmol,项目名称:LOFAR,代码行数:33,代码来源:plotcorrmatrix.py


示例18: buildUi

 def buildUi(self):
     self.verticalLayout = QVBoxLayout(self)
     self.figure = Figure()
     self.canvas = Canvas(self.figure)	                # <-- figure required
     self.navigationToolbar = NavigationToolbar(self.canvas, self)
     self.verticalLayout.addWidget(self.canvas)
     self.verticalLayout.addWidget(self.navigationToolbar)
开发者ID:emayssat,项目名称:python-eggs,代码行数:7,代码来源:matplot.py


示例19: __init__

 def __init__(self, h5file = None):
     QtGui.QWidget.__init__(self)        
     # define a right side control panel
     gLay = QtGui.QGridLayout()
     row = 0
     
     if isinstance(h5file, tables.file.File):
         self.h5file = h5file
         
     elif isinstance(h5file, str):
         self.h5file = str(QtGui.QFileDialog.getOpenFileName(caption='select an h5 file',
                                                             filter='*.h5'))
         if self.h5file:
             self.h5file = tables.openFile(self.h5file, 'r')
     
     elif not h5file:
         self.loadH5FileBtn = QtGui.QPushButton('Load H5File')
         self.loadH5FileBtn.clicked.connect(self.loadH5FileProc)
         gLay.addWidget(self.loadH5FileBtn, row, 0, 1, 2)
         row += 1
         self.setWindowTitle('Spike Sorting Quality Explorer')
             
     self.FirstUnitCombo = QtGui.QComboBox()
     gLay.addWidget(self.FirstUnitCombo, row, 0, 1, 2)
     row += 1
     
     self.selectBtn = QtGui.QPushButton('Select None')
     self.selectBtn.clicked.connect(self.selectProc)
     self.selectBtn.setCheckable(True)
     gLay.addWidget(self.selectBtn, row, 0)
     
     self.plotXCorrBtn = QtGui.QPushButton('Plot xCorr')
     self.plotXCorrBtn.clicked.connect(self.plotXCorr)
     gLay.addWidget(self.plotXCorrBtn, row, 1)
     row += 1
     
     self.UnitsSelector = QtGui.QTableWidget(0, 1)
     self.UnitsSelector.verticalHeader().setVisible(False)
     self.UnitsSelector.horizontalHeader().setVisible(False)
     self.UnitsSelector.setColumnWidth(0, 200)
     gLay.addWidget(self.UnitsSelector, row, 0, 1, 2)
     row += 1
     
     mainLay = QtGui.QHBoxLayout(self)
     mainLay.addLayout(gLay)
     
     # define a left side figure
     vLay = QtGui.QVBoxLayout()
     self.mainFig = MplWidget(self)
     self.mainFig.figure.set_facecolor('k')
     self.ntb = NavToolbar(self.mainFig, self)
     self.ntb.setIconSize(QtCore.QSize(15, 15))
     vLay.addWidget(self.mainFig)
     vLay.addWidget(self.ntb)
 
     mainLay.addLayout(vLay)        
     
     self.show()
     
     self.UnitChecks = []
开发者ID:hemanzur,项目名称:pySpikeSorter,代码行数:60,代码来源:spike_quality_widget.py


示例20: __init__

    def __init__(self, parent=None):
        super(Window, self).__init__(parent)
 
        self.figure = plt.figure()
        self.canvas = FigureCanvas(self.figure)
 
         
        self.toolbar = NavigationToolbar(self.canvas, self)
        self.toolbar.hide()
 
        # Just some button 
        self.button = QtGui.QPushButton('Plot')
        self.button.clicked.connect(self.plot)
 
        self.button1 = QtGui.QPushButton('Zoom')
        self.button1.clicked.connect(self.zoom)
         
        self.button2 = QtGui.QPushButton('Pan')
        self.button2.clicked.connect(self.pan)
         
        self.button3 = QtGui.QPushButton('Home')
        self.button3.clicked.connect(self.home)
 
 
        # set the layout
        layout = QtGui.QVBoxLayout()
        layout.addWidget(self.toolbar)
        layout.addWidget(self.canvas)
        layout.addWidget(self.button)
        layout.addWidget(self.button1)
        layout.addWidget(self.button2)
        layout.addWidget(self.button3)
        self.setLayout(layout)
开发者ID:SebastianRoll,项目名称:process-simulator-gui,代码行数:33,代码来源:zoompan_matplotlib.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python backend_qt5agg.FigureCanvasQTAgg类代码示例发布时间:2022-05-27
下一篇:
Python backend_qt4agg.NavigationToolbar2QT类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap