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


Python FigureCanvasBase.scroll_event方法代码示例

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


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

示例1: scroll_event

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import scroll_event [as 别名]
 def scroll_event(self, widget, event):
     x = event.x
     # flipy so y=0 is bottom of canvas
     y = self.get_allocation().height - event.y
     step = 1 if event.direction == Gdk.ScrollDirection.UP else -1
     FigureCanvasBase.scroll_event(self, x, y, step, guiEvent=event)
     return False  # finish event propagation?
开发者ID:QuLogic,项目名称:matplotlib,代码行数:9,代码来源:backend_gtk3.py

示例2: scroll_event

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import scroll_event [as 别名]
    def scroll_event(self, event):
        x = event.x
        y = self.figure.bbox.height - event.y
        num = getattr(event, 'num', None)
        if   num==4: step = +1
        elif num==5: step = -1
        else:        step =  0

        FigureCanvasBase.scroll_event(self, x, y, step, guiEvent=event)
开发者ID:astraw,项目名称:matplotlib,代码行数:11,代码来源:backend_tkagg.py

示例3: wheelEvent

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import scroll_event [as 别名]
 def wheelEvent(self, event):
     x = event.x()
     # flipy so y=0 is bottom of canvas
     y = self.figure.bbox.height - event.y()
     # from QWheelEvent::delta doc
     steps = event.delta() / 120
     if event.orientation() == QtCore.Qt.Vertical:
         FigureCanvasBase.scroll_event(
             self, x, y, steps, guiEvent=event)
开发者ID:endolith,项目名称:matplotlib,代码行数:11,代码来源:backend_qt5.py

示例4: wheelEvent

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import scroll_event [as 别名]
 def wheelEvent( self, event ):
     x = event.x()
     # flipy so y=0 is bottom of canvas
     y = self.figure.bbox.height - event.y()
     # from QWheelEvent::delta doc
     steps = event.delta()/120
     if (event.orientation() == QtCore.Qt.Vertical):
         FigureCanvasBase.scroll_event( self, x, y, steps)
         if DEBUG: print 'scroll event : delta = %i, steps = %i ' % (event.delta(),steps)
开发者ID:qsnake,项目名称:matplotlib,代码行数:11,代码来源:backend_qt4.py

示例5: wheelEvent

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import scroll_event [as 别名]
 def wheelEvent(self, event):
     x, y = self.mouseEventCoords(event)
     # from QWheelEvent::delta doc
     if event.pixelDelta().x() == 0 and event.pixelDelta().y() == 0:
         steps = event.angleDelta().y() / 120
     else:
         steps = event.pixelDelta().y()
     if steps:
         FigureCanvasBase.scroll_event(self, x, y, steps, guiEvent=event)
开发者ID:Eric89GXL,项目名称:matplotlib,代码行数:11,代码来源:backend_qt5.py

示例6: scroll_event_windows

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import scroll_event [as 别名]
 def scroll_event_windows(self, event):
     """MouseWheel event processor"""
     # need to find the window that contains the mouse
     w = event.widget.winfo_containing(event.x_root, event.y_root)
     if w == self._tkcanvas:
         x = event.x_root - w.winfo_rootx()
         y = event.y_root - w.winfo_rooty()
         y = self.figure.bbox.height - y
         step = event.delta/120.
         FigureCanvasBase.scroll_event(self, x, y, step, guiEvent=event)
开发者ID:astraw,项目名称:matplotlib,代码行数:12,代码来源:backend_tkagg.py

示例7: scroll_event

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import scroll_event [as 别名]
 def scroll_event(self, widget, event):
     x = event.x
     # flipy so y=0 is bottom of canvas
     y = self.allocation.height - event.y
     if event.direction==gdk.SCROLL_UP:
         step = 1
     else:
         step = -1
     FigureCanvasBase.scroll_event(self, x, y, step, guiEvent=event)
     return False  # finish event propagation?
开发者ID:Eric89GXL,项目名称:matplotlib,代码行数:12,代码来源:backend_gtk.py

示例8: scroll_event

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import scroll_event [as 别名]
 def scroll_event(self, widget, event):
     if _debug: print 'FigureCanvasGTK3.%s' % fn_name()
     x = event.x
     # flipy so y=0 is bottom of canvas
     y = self.get_allocation().height - event.y
     if event.direction==Gdk.ScrollDirection.UP:
         step = 1
     else:
         step = -1
     FigureCanvasBase.scroll_event(self, x, y, step, guiEvent=event)
     return False  # finish event propagation?
开发者ID:JackKelly,项目名称:matplotlib,代码行数:13,代码来源:backend_gtk3.py

示例9: scroll_event

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import scroll_event [as 别名]
 def scroll_event(self, widget, event):
     if _debug: print 'FigureCanvasGTK.{0!s}'.format(fn_name())
     x = event.x
     # flipy so y=0 is bottom of canvas
     y = self.allocation.height - event.y
     if event.direction==gdk.SCROLL_UP:
         step = 1
     else:
         step = -1
     FigureCanvasBase.scroll_event(self, x, y, step)
     return False  # finish event propagation?
开发者ID:runt18,项目名称:nupic,代码行数:13,代码来源:backend_gtk.py

示例10: wheelEvent

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import scroll_event [as 别名]
    def wheelEvent(self, event):
        x, y = self.mouseEventCoords(event)
        # from QWheelEvent::delta doc
        if event.pixelDelta().x() == 0 and event.pixelDelta().y() == 0:
            steps = event.angleDelta().y() / 120
        else:
            steps = event.pixelDelta().y()

        if steps != 0:
            FigureCanvasBase.scroll_event(self, x, y, steps, guiEvent=event)
            if DEBUG:
                print('scroll event: delta = %i, '
                      'steps = %i ' % (event.delta(), steps))
开发者ID:kshramt,项目名称:matplotlib,代码行数:15,代码来源:backend_qt5.py

示例11: wheelEvent

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import scroll_event [as 别名]
    def wheelEvent(self, event):
        x = event.x()
        # flipy so y=0 is bottom of canvas
        y = self.figure.bbox.height - event.y()
        # from QWheelEvent::delta doc
        if event.pixelDelta().x() == 0 and event.pixelDelta().y() == 0:
            steps = event.angleDelta().y() / 120
        else:
            steps = event.pixelDelta().y()

        if steps != 0:
            FigureCanvasBase.scroll_event(self, x, y, steps, guiEvent=event)
            if DEBUG:
                print("scroll event: delta = %i, " "steps = %i " % (event.delta(), steps))
开发者ID:zaherabdulazeez,项目名称:matplotlib,代码行数:16,代码来源:backend_qt5.py

示例12: scroll_event

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import scroll_event [as 别名]
 def scroll_event(self, event):
     x = event.x
     y = self.figure.bbox.height - event.y
     num = getattr(event, 'num', None)
     step = 1 if num == 4 else -1 if num == 5 else 0
     FigureCanvasBase.scroll_event(self, x, y, step, guiEvent=event)
开发者ID:HubertHolin,项目名称:matplotlib,代码行数:8,代码来源:_backend_tk.py


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