本文整理汇总了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)
示例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()
示例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()
示例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()
示例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)
示例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)
示例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)