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


Python FigureCanvasQTAgg.mouseMoveEvent方法代码示例

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


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

示例1: mouseMoveEvent

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import mouseMoveEvent [as 别名]
 def mouseMoveEvent(self, event):
     FigureCanvasQTAgg.mouseMoveEvent(self, event)
     pixel_x = event.x()
     pixel_y = event.y()
     ra, dec = self._gc.pixel2world(pixel_x, pixel_y)
     inverted = self._fig.gca().transData.inverted()
     x, y = inverted.transform((pixel_x, pixel_y))
     try:
         if x < 0 or y < 0:
             value = None
         else:
             value = self._gc._data[self._gc._data.shape[0] - y][x]
     except IndexError:
         value = None
     self.hoverSignal.emit(x, y, value, ra, dec)
开发者ID:badders,项目名称:pyfitsview,代码行数:17,代码来源:fitsview.py

示例2: mouseMoveEvent

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import mouseMoveEvent [as 别名]
 def mouseMoveEvent(self, event):
     FigureCanvas.mouseMoveEvent(self, event)
     self.VCursor.moveLines(x=event.x(),
                            y=self.frameSize().height() - event.y())
开发者ID:Subaru-PFS,项目名称:ics_sps_engineering_plotData,代码行数:6,代码来源:graph.py


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