Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e85f1c3 + 1cc671b commit 513637bCopy full SHA for 513637b
lib/matplotlib/backends/backend_qt4agg.py
@@ -102,10 +102,16 @@ def paintEvent( self, e ):
102
103
refcnt = sys.getrefcount(stringBuffer)
104
105
+ # convert the Agg rendered image -> qImage
106
qImage = QtGui.QImage(stringBuffer, self.renderer.width,
107
self.renderer.height,
108
QtGui.QImage.Format_ARGB32)
109
+ # get the rectangle for the image
110
+ rect = qImage.rect()
111
p = QtGui.QPainter(self)
112
+ # reset the image area of the canvas to be the back-ground color
113
+ p.eraseRect(rect)
114
+ # draw the rendered image on to the canvas
115
p.drawPixmap(QtCore.QPoint(0, 0), QtGui.QPixmap.fromImage(qImage))
116
117
# draw the zoom rectangle to the QPainter
0 commit comments