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

Python backend_wxagg.NavigationToolbar2WxAgg类代码示例

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

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



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

示例1: __init__

    def __init__(self, canvas, main):
        self.main = main

        navId = wx.NewId()
        NavigationToolbar2WxAgg.__init__(self, canvas)
        self.AddSimpleTool(navId, _load_bitmap("subplots.png"), "Range", "Set plot range")
        wx.EVT_TOOL(self, navId, self.on_range)
开发者ID:stephenong,项目名称:RTLSDR-Scanner,代码行数:7,代码来源:rtlsdr_scan.py


示例2: __init__

    def __init__(self, plotCanvas):
        # create the default toolbar
        NavigationToolbar2WxAgg.__init__(self, plotCanvas)
        # remove the unwanted button
        POSITION_OF_CONFIGURE_SUBPLOTS_BTN = 7

        self.DeleteToolByPos(POSITION_OF_CONFIGURE_SUBPLOTS_BTN)
开发者ID:Edasn,项目名称:CaptorRadio-v2,代码行数:7,代码来源:interfaz2.py


示例3: __init__

    def __init__(self, canvas, cankill):
        NavigationToolbar2WxAgg.__init__(self, canvas)
        self.canvas = canvas
        #setattr(self,'datajours', getattr(canvas.GetParent(),'datajours'))
        for name in dir(canvas.GetParent()):
	    #print "name= :", name
            if name in ["datayear","vg0","vg0_2","year","nyear","month","day","nday","pm10","aot1020"]:
                setattr(self,name,getattr(canvas.GetParent(),name))
	
       

        # for simplicity I'm going to reuse a bitmap from wx, you'll
        # probably want to add your own.
        self.ON_PREVIOUS = wx.NewId()
        self.ON_NEXT = wx.NewId()
        self.ON_LISTE = wx.NewId()

        self.AddSimpleTool(self.ON_PREVIOUS, _load_bitmap('stock_left.xpm'), 'Courbe precedente', 'Courbe precedente')
        self.AddSimpleTool(self.ON_NEXT, _load_bitmap('stock_right.xpm'), 'Courbe suivante', 'Courbe suivante')
        self.AddSimpleTool(self.ON_LISTE, _load_bitmap('stock_up.xpm'), 'Liste par date', 'Liste par date')

        wx.EVT_TOOL(self, self.ON_PREVIOUS, self._on_previous)
        wx.EVT_TOOL(self, self.ON_NEXT, self._on_next)
        wx.EVT_TOOL(self, self.ON_LISTE, self._on_liste)
	
	self.inityear()
        
        self.draw()
开发者ID:fbrute,项目名称:pm_aot_tfeuilla,代码行数:28,代码来源:wxpy_aot_pm10_2006_ou_2012_sep_dec.py


示例4: __init__

    def __init__(self, canvas, cankill):
        NavigationToolbar2WxAgg.__init__(self, canvas)

        # for simplicity I'm going to reuse a bitmap from wx, you'll
        # probably want to add your own.
        self.AddSimpleTool(self.ON_CUSTOM, _load_bitmap("stock_left.xpm"), "Click me", "Activate custom contol")
        EVT_TOOL(self, self.ON_CUSTOM, self._on_custom)
开发者ID:eddienko,项目名称:SamPy,代码行数:7,代码来源:embedding_in_wx4.py


示例5: __init__

    def __init__(self, frame_object):
        """ Constructor for toolbar object

        @type self: Toolbar
        @type frame_object: MainFrame
            the frame object that the toolbar will be in/part of
        @rtype: None
        """
        NavigationToolbar2WxAgg.__init__(self, frame_object.canvas)
        self.frame_object = frame_object        
        # Deleting unwanted icons in standard toolbar
        self.DeleteToolByPos(8)
        self.DeleteToolByPos(1)
        self.DeleteToolByPos(1)
        
        self.InsertSeparator(6)
        self.InsertSeparator(6)

        self.AddSimpleTool(self.ON_PREVIOUS, _load_bitmap('back.png'),
                           'Previous Run', 'Activate custom control')
        wx.EVT_TOOL(self, self.ON_PREVIOUS, self._on_previous)
        
        self.AddSimpleTool(self.ON_NEXT, _load_bitmap('forward.png'),
                           'Next Run', 'Activate custom control')
        wx.EVT_TOOL(self, self.ON_NEXT, self._on_next)        
        
        self.AddSimpleTool(self.ON_EXTRACT, _load_bitmap('filesave.png'),
                           'Save to Excel', 'Activate custom control')
        wx.EVT_TOOL(self, self.ON_EXTRACT, self._on_extract)
开发者ID:rubenflamshepherd,项目名称:CATEautomator,代码行数:29,代码来源:Custom.py


示例6: __init__

    def __init__(self, canvas, cankill):
        NavigationToolbar2WxAgg.__init__(self, canvas)

        # for simplicity I'm going to reuse a bitmap from wx, you'll
        # probably want to add your own.
        self.ON_PREVIOUS = wx.NewId()
        self.ON_NEXT = wx.NewId()
        self.ON_LISTE = wx.NewId()

        self.AddSimpleTool(self.ON_PREVIOUS, _load_bitmap('stock_left.xpm'), 'Courbe precedente', 'Courbe precedente')
        self.AddSimpleTool(self.ON_NEXT, _load_bitmap('stock_right.xpm'), 'Courbe suivante', 'Courbe suivante')
        self.AddSimpleTool(self.ON_LISTE, _load_bitmap('stock_up.xpm'), 'Liste par date', 'Liste par date')

        wx.EVT_TOOL(self, self.ON_PREVIOUS, self._on_previous)
        wx.EVT_TOOL(self, self.ON_NEXT, self._on_next)
        wx.EVT_TOOL(self, self.ON_LISTE, self._on_liste)

        self.diryears = datayears

        print self.diryears
        #keys_sort = self.diryears.keys()
        #keys_sort.sort()
        #self.premyear = self.diryears[keys_sort[0]]
        #self.premyear = datayears[0]
        self.premyear = 2005
        #self.deryear = self.diryears[keys_sort[len(keys_sort)-1]]
        #self.deryear = datayears[len(datayears)-1] 
        self.deryear = 2012 
        self.njour = self.premyear 
        self.compteuryear = 0 

        self.prepdata()
        self.draw()
开发者ID:fbrute,项目名称:pm_aot_tfeuilla,代码行数:33,代码来源:wx_py_aot_pm10_reg.py


示例7: __init__

    def __init__(self, plotCanvas):
        NavigationToolbar2WxAgg.__init__(self, plotCanvas)
        
#        self.SetToolBitmapSize(wx.Size(10,10))
        # delete unwanted tools
        self.DeleteToolByPos(6) # Configure subplots
        self.DeleteToolByPos(3) # Pan

        self.Realize()
开发者ID:xquiet,项目名称:openstereonet,代码行数:9,代码来源:RosePanel.py


示例8: __init__

 def __init__(self, plot_canvas):
     NavigationToolbar2WxAgg.__init__(self, plot_canvas)
     #Delete home tool
     #TODO add after history clear is added at each plot_refresh
     self.DeleteToolByPos(0)
     #add refresh plot button
     self.AddSimpleTool(self.ON_CUSTOM, _load_bitmap('stock_refresh.xpm'),
                        'Click me', 'Activate custom control')
     wx.EVT_TOOL(self, self.ON_CUSTOM, self._on_custom)
开发者ID:kolodkin,项目名称:CsvPlotter,代码行数:9,代码来源:CsvPlotter.py


示例9: __init__

    def __init__(self, canvas, panel, settings, callBackHideOverlay):
        self.panel = panel
        self.settings = settings
        self.callBackHideOverlay = callBackHideOverlay
        self.plot = None
        self.extraTools = []
        self.panPos = None

        NavigationToolbar2WxAgg.__init__(self, canvas)
        if matplotlib.__version__ >= '1.2':
            panId = self.wx_ids['Pan']
        else:
            panId = self.FindById(self._NTB2_PAN).GetId()

        self.ToggleTool(panId, True)
        self.pan()

        self.__add_spacer()

        liveId = wx.NewId()
        self.AddCheckTool(liveId, load_bitmap('auto_refresh'),
                          shortHelp='Real time plotting\n(slow and buggy)')
        self.ToggleTool(liveId, settings.liveUpdate)
        wx.EVT_TOOL(self, liveId, self.__on_check_update)

        gridId = wx.NewId()
        self.AddCheckTool(gridId, load_bitmap('grid'),
                          shortHelp='Toggle plot grid')
        self.ToggleTool(gridId, settings.grid)
        wx.EVT_TOOL(self, gridId, self.__on_check_grid)

        peakId = wx.NewId()
        self.AddCheckTool(peakId, load_bitmap('peak'),
                          shortHelp='Label peak')
        self.ToggleTool(peakId, settings.annotate)
        wx.EVT_TOOL(self, peakId, self.__on_check_peak)

        self.__add_spacer()

        self.autoFId = wx.NewId()
        self.AddCheckTool(self.autoFId, load_bitmap('auto_f'),
                          shortHelp='Auto range frequency')
        self.ToggleTool(self.autoFId, settings.autoF)
        wx.EVT_TOOL(self, self.autoFId, self.__on_check_auto_f)

        self.autoLId = wx.NewId()
        self.AddCheckTool(self.autoLId, load_bitmap('auto_l'),
                          shortHelp='Auto range level')
        self.ToggleTool(self.autoLId, settings.autoL)
        wx.EVT_TOOL(self, self.autoLId, self.__on_check_auto_l)

        self.autoTId = None
        self.maxId = None
        self.minId = None
        self.avgId = None
        self.varId = None
        self.colourId = None
开发者ID:B-Rich,项目名称:RTLSDR-Scanner,代码行数:57,代码来源:toolbars.py


示例10: __init__

 def __init__(self, canvas, tools=('Home', 'Pan', 'Zoom', 'Save')):
     NavigationToolbar2WxAgg.__init__(self, canvas)
     i = 0
     for pos, tool in enumerate(self.toolitems):
         if tool[0] not in tools:
             self.DeleteToolByPos(pos-i)
             i+=1
     self.AddSimpleTool(self.ON_CONFIG, wx.Bitmap(basedir+'/images/preferences-system-mpl.png'),
                        'Customize', 'Customize')
     wx.EVT_TOOL(self, self.ON_CONFIG, self._on_config)
开发者ID:mrkwjc,项目名称:ffnetui,代码行数:10,代码来源:mplwx.py


示例11: __init__

    def __init__(self,  canvas):
        NavigationToolbar2WxAgg.__init__(self,canvas)

        # # In mpl 1.2 the Toolbar is restructured which requires a hack
        # if int(matplotlib.__version__.split('.')[1]) >= 2:
        #     self._NTB2_PAN = self.wx_ids['Pan']
        #     self._NTB2_ZOOM = self.wx_ids['Zoom']

        # self._CHECK_TOOLS = (self._NTB2_PAN,self._NTB2_ZOOM,self._LINESELECT,self._PIXELINSPECTOR)
        self.canvas = canvas
开发者ID:pathoren,项目名称:FigureLoader,代码行数:10,代码来源:FigureLoader.py


示例12: __init__

    def __init__(self, canvas, cankill):
        NavigationToolbar2WxAgg.__init__(self, canvas)

        # for simplicity I'm going to reuse a bitmap from wx, you'll
        # probably want to add your own.
        self.AddSimpleTool(self.ON_CUSTOM, _load_bitmap('stock_left.xpm'),
                           'Click me', 'Activate custom contol')
        #self.AddSimpleTool(self.ON_CUSTOM, _load_bitmap('stock_left.xpm'),
                           #'Click me', 'Save to PDF format')       
        wx.EVT_TOOL(self, self.ON_CUSTOM, self._on_custom)
        #wx.EVT_TOOL(self, self.ON_SAVETOPDF, self._on_savetopdf)
        self.canvas = canvas
开发者ID:Junlings,项目名称:webfe,代码行数:12,代码来源:plotframe.py


示例13: __init__

    def __init__(self, canvas, cankill):
        NavigationToolbar2WxAgg.__init__(self, canvas)

        # for simplicity I'm going to reuse a bitmap from wx, you'll
        # probably want to add your own.wx.ART_FOLDER_OPEN 
        #wx.ArtProvider.GetBitmap(wx.ART_FOLDER_OPEN) is the stock icons command
        self.AddSimpleTool(self.ON_CUSTOM, wx.ArtProvider.GetBitmap(wx.ART_FOLDER_OPEN),
                           'Plot measurement', 'Plot an XML data file')
        wx.EVT_TOOL(self, self.ON_CUSTOM, self._on_custom)
        
        self.AddSimpleTool(self.ON_CUSTOM, wx.ArtProvider.GetBitmap(wx.ART_FOLDER_OPEN),
                           'Click me', 'Activate custom contol')
开发者ID:aricsanders,项目名称:pyMeasureNew,代码行数:12,代码来源:MatplotlibWxPanel.py


示例14: __init__

    def __init__(self, parent, canvas, cankill, OnUndo):

        self.cid = 0
        self.circles = []
        self.point3 = array([])
        self.point2 = array([])
        self.lines = []
        self.hist = ["start"]

        NavigationToolbar2WxAgg.__init__(self, canvas)

        self.statbar = None

        self.OnUndo = OnUndo
        self.parent = parent

        if self.parent.mpl_old:
            self.wx_ids = {"Pan": self._NTB2_PAN, "Zoom": self._NTB2_ZOOM}

        self.AddSeparator()

        self.AddCheckTool(
            self.ON_MARKRINGS,
            _load_bitmap(os.path.join(self.parent.iconspath, "3_point.png")),
            shortHelp="Mark Rings",
            longHelp="mark 3-points on a ring to find center",
        )
        wx.EVT_TOOL(self, self.ON_MARKRINGS, self._on_markrings)
        self.AddCheckTool(
            self.ON_MARKSPOTS,
            _load_bitmap(os.path.join(self.parent.iconspath, "2_point.png")),
            shortHelp="Mark Spots",
            longHelp="mark 2 spots to measure distance",
        )
        wx.EVT_TOOL(self, self.ON_MARKSPOTS, self._on_markspots)

        self.AddSeparator()

        self.AddSimpleTool(
            self.ON_INTEGRATE,
            _load_bitmap(os.path.join(self.parent.iconspath, "profile.png")),
            "Profile",
            "Extract profiles from the diffraction pattern",
        )
        wx.EVT_TOOL(self, self.ON_INTEGRATE, self._on_integrate)
        undo_ico = wx.ArtProvider.GetBitmap(wx.ART_UNDO, wx.ART_TOOLBAR, (16, 16))
        self.AddSimpleTool(self.ON_UNDO, undo_ico, "Undo", "Undo last point or ring")
        wx.EVT_TOOL(self, self.ON_UNDO, self._on_undo)
开发者ID:bcolsen,项目名称:diffraction-ring-profiler,代码行数:48,代码来源:diffraction_ring_profiler.py


示例15: __init__

    def __init__(self, canvas, panel, settings, callBackHideOverlay):
        self.panel = panel
        self.settings = settings
        self.callbackHide = callBackHideOverlay
        self.plot = None
        self.extraTools = []
        self.panPos = None

        NavigationToolbar2WxAgg.__init__(self, canvas)
        if matplotlib.__version__ >= '1.2':
            panId = self.wx_ids['Pan']
        else:
            panId = self.FindById(self._NTB2_PAN).GetId()

        self.ToggleTool(panId, True)
        self.pan()

        self.__add_spacer(False)

        liveId = wx.NewId()
        self.AddCheckTool(liveId, load_bitmap('auto_refresh'),
                          shortHelp='Real time plotting\n(slow and buggy)')
        self.ToggleTool(liveId, settings.liveUpdate)
        wx.EVT_TOOL(self, liveId, self.__on_check_update)

        gridId = wx.NewId()
        self.AddCheckTool(gridId, load_bitmap('grid'),
                          shortHelp='Toggle plot_line grid')
        self.ToggleTool(gridId, settings.grid)
        wx.EVT_TOOL(self, gridId, self.__on_check_grid)

        self.peakId = wx.NewId()
        self.peaksId = None

        self.autoFId = None
        self.autoLId = None
        self.autoTId = None

        self.maxId = None
        self.minId = None
        self.avgId = None
        self.varId = None
        self.smoothId = None
        self.diffId = None
        self.deltaId = None

        self.colourId = None
开发者ID:PatMart,项目名称:RTLSDR-Scanner,代码行数:47,代码来源:toolbars.py


示例16: MPLPanel

class MPLPanel(wx.Panel):
    def __init__(self, *args, **kwargs):
        super(MPLPanel, self).__init__(*args, **kwargs)

        # Setup the canvas
        self.dpi = 100
        self.fig = Figure((3.0, 2.0), dpi=self.dpi)
        self.ax1 = None
        self.ax2 = None
        self.canvas = FigCanvas(self, -1, self.fig)
        self.data = []

        # Setup the toolbar/statustextctrl
        self.toolbar = NavigationToolbar(self.canvas)
        self.toolbar.dynamic_update()
        self.testButton = wx.Button(self.toolbar, label="Pause")
        self.toolbar.AddControl(self.testButton)
        self.toolbar.AddSeparator()
        self.statusctrl = wx.StaticText(self.toolbar, style=wx.TE_READONLY, size=wx.Size(300, 25))
        self.toolbar.AddControl(self.statusctrl)

        # Do the layout
        panelvbox = wx.BoxSizer(wx.VERTICAL)
        panelvbox.Add(self.canvas, 1, flag=wx.EXPAND | wx.GROW | wx.ALL)
        panelvbox.Add(self.toolbar, 0, flag=wx.EXPAND | wx.GROW | wx.ALL)
        self.SetSizer(panelvbox)
        panelvbox.Fit(self)
        self.canvas.draw()
开发者ID:asippel89,项目名称:hologui,代码行数:28,代码来源:mplpanel.py


示例17: __init__

    def __init__(self, canvas, cankill):
        NavigationToolbar.__init__(self, canvas)

        # for simplicity I'm going to reuse a bitmap from wx, you'll
        # probably want to add your own.
        tool = self.AddTool(wx.ID_ANY, 'Click me', _load_bitmap('back.png'),
                            'Activate custom contol')
        self.Bind(wx.EVT_TOOL, self._on_custom, id=tool.GetId())
开发者ID:NelleV,项目名称:matplotlib,代码行数:8,代码来源:embedding_in_wx4_sgskip.py


示例18: __init__

		def __init__(self,canvas_,parent_):
			self.toolitems = (
				('Home', 'Reset original view', 'home', 'home'),
				('Pan', 'Pan axes with left mouse, zoom with right', 'move', 'pan'),
				('Zoom', 'Zoom to rectangle', 'zoom_to_rect', 'zoom'),
				(None, None, None, None),
				('Save', 'Save the figure', 'filesave', 'save_figure'),
				)
			NavigationToolbar.__init__(self,canvas_)
开发者ID:MorganAskins,项目名称:SIS3316,代码行数:9,代码来源:scope.py


示例19: __init__

 def __init__(self, plotCanvas):
     # create the default toolbar
     NavigationToolbar.__init__(self, plotCanvas)
     # find where icons are located
     path = os.path.dirname(__file__)
     icon_file = os.path.join(path, 'data-export-icon.png')
     self.AddSimpleTool(self.EXPORT_DATA, _load_bitmap(icon_file),
                        'Export data', 'Export current data to file')
     wx.EVT_TOOL(self, self.EXPORT_DATA, self._on_export_data)
开发者ID:ansobolev,项目名称:shs,代码行数:9,代码来源:PlotFrame.py


示例20: __init__

    def __init__(self, plotCanvas, multPlots=False, allowselect=False):
        NavigationToolbar.__init__(self, plotCanvas)
        #self.ClearTools()


        # delete the toolbar button we don't want
        if (not multPlots):
            CONFIGURE_SUBPLOTS_TOOLBAR_BTN_POSITION = 8
            self.DeleteToolByPos(CONFIGURE_SUBPLOTS_TOOLBAR_BTN_POSITION)

        #self.AddSimpleTool(self.ON_CUSTOM_LEFT, scroll_left.GetBitmap(), ' Pan to the left', 'Pan graph to the left')
        #self.AddSimpleTool(self.ON_CUSTOM_RIGHT, scroll_right.GetBitmap(), 'Pan to the right', 'Pan graph to the right')

        #wx.EVT_TOOL(self, self.ON_CUSTOM_LEFT, self._on_custom_pan_left)
        #wx.EVT_TOOL(self, self.ON_CUSTOM_RIGHT, self._on_custom_pan_right)

        if allowselect:
            """self.select_tool = self.AddSimpleTool(self.ON_LASSO_SELECT, select.GetBitmap(), 'Lasso Select',
                                                  'Select datavalues from the graph', isToggle=True)

            self.zoom_to_data = self.AddSimpleTool(self.ON_ZOOM_DATA_SELECT, zoom_data.GetBitmap(), 'Zoom to Data',
                                                  'Zoom to data without NoDataValues')

            wx.EVT_TOOL(self, self.ON_LASSO_SELECT, self.on_toggle_lasso_tool)
            wx.EVT_TOOL(self, self.ON_ZOOM_DATA_SELECT, self.on_toggle_zoom_data_tool)"""

            # Get the ids for the existing tools
            self.pan_tool = self.FindById(self.wx_ids['Pan'])
            self.zoom_tool = self.FindById(self.wx_ids['Zoom'])
            self.select_tool=self.FindById(self.wx_ids['Select'])
            self.zoom_to_data = self.FindById(self.wx_ids['Zoom to Data'])

            wx.EVT_TOOL(self, self.zoom_tool.Id, self.on_toggle_pan_zoom)
            wx.EVT_TOOL(self, self.pan_tool.Id, self.on_toggle_pan_zoom)
            self.lassoAction = None
            self.select_tool.Enable(False)
            self.zoom_to_data.Enable(False)

        else:
            ZOOM_DATA_BTN_POSITION = 1
            SELECT_DATA_BTN_POSTITION = self.ToolsCount-1
            self.DeleteToolByPos(SELECT_DATA_BTN_POSTITION)
            self.DeleteToolByPos(ZOOM_DATA_BTN_POSITION)


        self.SetToolBitmapSize(wx.Size(16, 16))

        #msg = wx.StaticText(self, -1, '|')
        #msg.SetForegroundColour((108, 123, 139))

        #self.AddControl(msg)
        self.AddSeparator()

        self.msg = wx.StaticText(self, -1, "")
        self.AddControl(self.msg)

        self.Realize()
开发者ID:fl0f,项目名称:ODMToolsPython,代码行数:57,代码来源:mnuPlotToolbar.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python figureoptions.figure_edit函数代码示例发布时间:2022-05-27
下一篇:
Python backend_wxagg.FigureCanvasWxAgg类代码示例发布时间: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