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


Python FigureCanvasWxAgg._onPaint方法代码示例

本文整理汇总了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)
开发者ID:xanderhsia,项目名称:pyopus,代码行数:28,代码来源:wxmplitf.py

示例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)
开发者ID:piScope,项目名称:piScope,代码行数:22,代码来源:backend_wxagg_mod.py

示例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()
开发者ID:eternallyBaffled,项目名称:itrade,代码行数:7,代码来源:itrade_wxgraph.py


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