Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 750e123

Browse files
committed
applied barrys cocoaagg patch
svn path=/trunk/matplotlib/; revision=4571
1 parent 2cda57c commit 750e123

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

lib/matplotlib/backends/backend_cocoaagg.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ def awakeFromNib(self):
7878
self.plotWindow.setDelegate_(self)#.plotView)
7979

8080
self.plotView.setImageFrameStyle_(NSImageFrameGroove)
81-
self.plotView.image = NSImage.alloc().initWithSize_((0,0))
82-
self.plotView.setImage_(self.plotView.image)
81+
self.plotView.image_ = NSImage.alloc().initWithSize_((0,0))
82+
self.plotView.setImage_(self.plotView.image_)
8383

8484
# Make imageview first responder for key events
8585
self.plotWindow.makeFirstResponder_(self.plotView)
@@ -112,10 +112,10 @@ def updatePlot(self):
112112
w,h = self.canvas.get_width_height()
113113

114114
# Remove all previous images
115-
for i in xrange(self.image.representations().count()):
116-
self.image.removeRepresentation_(self.image.representations().objectAtIndex_(i))
115+
for i in xrange(self.image_.representations().count()):
116+
self.image_.removeRepresentation_(self.image_.representations().objectAtIndex_(i))
117117

118-
self.image.setSize_((w,h))
118+
self.image_.setSize_((w,h))
119119

120120
brep = NSBitmapImageRep.alloc().initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bytesPerRow_bitsPerPixel_(
121121
(self.canvas.buffer_rgba(0,0),'','','',''), # Image data
@@ -129,7 +129,7 @@ def updatePlot(self):
129129
w*4, # row bytes
130130
32) # bits per pixel
131131

132-
self.image.addRepresentation_(brep)
132+
self.image_.addRepresentation_(brep)
133133
self.setNeedsDisplay_(True)
134134

135135
def windowDidResize_(self, sender):

0 commit comments

Comments
 (0)