本文整理汇总了Python中matplotlib.backends.backend_wxagg.FigureCanvasWxAgg._onPaint方法的典型用法代码示例。如果您正苦于以下问题:Python FigureCanvasWxAgg._onPaint方法的具体用法?Python FigureCanvasWxAgg._onPaint怎么用?Python FigureCanvasWxAgg._onPaint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backends.backend_wxagg.FigureCanvasWxAgg
的用法示例。
在下文中一共展示了FigureCanvasWxAgg._onPaint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _onPaint
# 需要导入模块: from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg [as 别名]
# 或者: from matplotlib.backends.backend_wxagg.FigureCanvasWxAgg import _onPaint [as 别名]
def _onPaint(self, evt):
"""
Overrides the :class:`FigureCanvasWxAgg` paint event to redraw the
crosshairs, etc.
"""
# We have now
dc = wx.ClientDC(self)
if self.repaintEnabled:
# Clear the crosshairs and the rubberband from the whole area
# This will damage the area that will be repainted, but after repaint
# it will be OK.
ch=self.crosshairs.clear(dc)
rb=self.rubberband.clear(dc)
del dc
FigureCanvasWxAgg._onPaint(self, evt)
# At this point the figure should be complete clear of any crosshairs or rubberband
# Now paint the crosshairs and the rubberband on the whole area
dc = wx.ClientDC(self)
self.crosshairs.redraw(dc, ch)
self.rubberband.redraw(dc, rb)
del dc
dc = wx.PaintDC(self)
示例2: _onPaint
# 需要导入模块: from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg [as 别名]
# 或者: from matplotlib.backends.backend_wxagg.FigureCanvasWxAgg import _onPaint [as 别名]
def _onPaint(self, evt):
def scale_bitmap(figure_image, bitmap):
h, w, d = figure_image.shape
bitmapw, bitmaph = bitmap.GetSize()
image = wxEmptyImage(w, h)
image.SetData(figure_image[:,:,0:3].tostring())
image_SetAlpha(image, figure_image[:,:,3])
return image.Scale(csize[0], csize[1]).ConvertToBitmap()
csize = self.GetClientSize()
if self.figure_image is not None:
h, w, d = self.figure_image[0].shape
if (csize[0] != w or
csize[1] != h) :
self.bitmap = scale_bitmap(self.figure_image[0], self.bitmap)
self._isDrawn=True
else:
self._isDrawn = False
CanvasAgg._onPaint(self, evt)
示例3: _onPaint
# 需要导入模块: from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg [as 别名]
# 或者: from matplotlib.backends.backend_wxagg.FigureCanvasWxAgg import _onPaint [as 别名]
def _onPaint(self, event):
#print '$$$ _onPaint ex : call default _onPaint'
FigureCanvas._onPaint(self, event)
#print '$$$ _onPaint ex : call drawAllObjects in parent'
self.m_parent.drawAllObjects()