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


Python FigureCanvasBase.resize_event方法代码示例

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


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

示例1: resize

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import resize_event [as 别名]
 def resize(self, width, height):
     self.renderer.set_width_height(width, height)
     dpi = self.figure.dpi
     width /= dpi
     height /= dpi
     self.figure.set_size_inches(width, height)
     FigureCanvasBase.resize_event(self)
开发者ID:ethanhelfman,项目名称:InstaGet,代码行数:9,代码来源:backend_macosx.py

示例2: size_allocate

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import resize_event [as 别名]
 def size_allocate(self, widget, allocation):
     dpival = self.figure.dpi
     winch = allocation.width / dpival
     hinch = allocation.height / dpival
     self.figure.set_size_inches(winch, hinch, forward=False)
     FigureCanvasBase.resize_event(self)
     self.draw_idle()
开发者ID:jklymak,项目名称:matplotlib,代码行数:9,代码来源:backend_gtk3.py

示例3: resize

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import resize_event [as 别名]
 def resize(self, width, height):
     dpi = self.figure.dpi
     width /= dpi
     height /= dpi
     self.figure.set_size_inches(width * self._device_scale,
                                 height * self._device_scale)
     FigureCanvasBase.resize_event(self)
     self.draw_idle()
开发者ID:bastibe,项目名称:matplotlib,代码行数:10,代码来源:backend_macosx.py

示例4: size_allocate

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import resize_event [as 别名]
 def size_allocate(self, widget, allocation):
     if _debug:
         print("FigureCanvasGTK3.%s" % fn_name())
         print("size_allocate (%d x %d)" % (allocation.width, allocation.height))
     dpival = self.figure.dpi
     winch = allocation.width / dpival
     hinch = allocation.height / dpival
     self.figure.set_size_inches(winch, hinch, forward=False)
     FigureCanvasBase.resize_event(self)
     self.draw_idle()
开发者ID:RealGeeks,项目名称:matplotlib,代码行数:12,代码来源:backend_gtk3.py

示例5: resizeEvent

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import resize_event [as 别名]
 def resizeEvent(self, event):
     w = event.size().width() * self._dpi_ratio
     h = event.size().height() * self._dpi_ratio
     dpival = self.figure.dpi
     winch = w / dpival
     hinch = h / dpival
     self.figure.set_size_inches(winch, hinch, forward=False)
     FigureCanvasBase.resize_event(self)
     self.draw_idle()
     QtWidgets.QWidget.resizeEvent(self, event)
开发者ID:LindyBalboa,项目名称:matplotlib,代码行数:12,代码来源:backend_qt5.py

示例6: resizeEvent

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import resize_event [as 别名]
 def resizeEvent(self, event):
     w = event.size().width()
     h = event.size().height()
     if DEBUG:
         print('resize (%d x %d)' % (w, h))
         print("FigureCanvasQt.resizeEvent(%d, %d)" % (w, h))
     dpival = self.figure.dpi
     winch = w / dpival
     hinch = h / dpival
     self.figure.set_size_inches(winch, hinch)
     FigureCanvasBase.resize_event(self)
     self.draw_idle()
     QtWidgets.QWidget.resizeEvent(self, event)
开发者ID:Acanthostega,项目名称:matplotlib,代码行数:15,代码来源:backend_qt5.py

示例7: resizeEvent

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import resize_event [as 别名]
 def resizeEvent(self, event):
     # _dpi_ratio_prev will be set the first time the canvas is painted, and
     # the rendered buffer is useless before anyways.
     if self._dpi_ratio_prev is None:
         return
     w = event.size().width() * self._dpi_ratio
     h = event.size().height() * self._dpi_ratio
     dpival = self.figure.dpi
     winch = w / dpival
     hinch = h / dpival
     self.figure.set_size_inches(winch, hinch, forward=False)
     # pass back into Qt to let it finish
     QtWidgets.QWidget.resizeEvent(self, event)
     # emit our resize events
     FigureCanvasBase.resize_event(self)
开发者ID:endolith,项目名称:matplotlib,代码行数:17,代码来源:backend_qt5.py


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