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

Skip to content

Commit 8e72ee5

Browse files
author
Steve Chaplin
committed
SC 2005/03/12
svn path=/trunk/matplotlib/; revision=1072
1 parent 08c2695 commit 8e72ee5

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

lib/matplotlib/backends/backend_gdk.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ def draw_image(self, x, y, im, origin, bbox):
116116
has_alpha=True, bits_per_sample=8,
117117
width=cols, height=rows)
118118
try:
119-
pa = pb.get_pixels_array()
119+
pa = pb.get_pixels_array() # new in 2.2
120120
except AttributeError:
121-
pa = pb.pixel_array # deprecated
121+
pa = pb.pixel_array # deprecated in 2.2
122122
except RuntimeError, exc: # pygtk was not compiled with Numeric Python support
123123
warnings.warn('draw_image not supported: %s' % exc)
124124
return
@@ -130,13 +130,13 @@ def draw_image(self, x, y, im, origin, bbox):
130130
if flipud:
131131
y = self.height-y-rows
132132

133-
try: # requires GTK+ 2.2
133+
try: # new in 2.2
134134
# can use None instead of gc.gdkGC, if don't need clipping
135135
self.gdkDrawable.draw_pixbuf (gc.gdkGC, pb, 0, 0,
136136
int(x), int(y), cols, rows,
137137
gdk.RGB_DITHER_NONE, 0, 0)
138138
except AttributeError:
139-
# is deprecated
139+
# deprecated in 2.2
140140
pb.render_to_drawable(self.gdkDrawable, gc.gdkGC, 0, 0,
141141
int(x), int(y), cols, rows,
142142
gdk.RGB_DITHER_NONE, 0, 0)
@@ -233,9 +233,9 @@ def _draw_mathtext(self, gc, x, y, s, prop, angle):
233233
bits_per_sample=8, width=imw, height=imh)
234234

235235
try:
236-
pa = pb.get_pixels_array()
236+
pa = pb.get_pixels_array() # new in 2.2
237237
except AttributeError:
238-
pa = pb.pixel_array
238+
pa = pb.pixel_array # deprecated in 2.2
239239
except RuntimeError, exc: # 'pygtk was not compiled with Numeric Python support'
240240
warnings.warn('mathtext not supported: %s' % exc)
241241
return
@@ -246,12 +246,13 @@ def _draw_mathtext(self, gc, x, y, s, prop, angle):
246246
pa[:,:,2]=int(rgb[2]*255)
247247
pa[:,:,3]=Xs
248248

249-
try: # requires GTK+ 2.2
249+
try: # new in 2.2
250250
# can use None instead of gc.gdkGC, if don't need clipping
251251
self.gdkDrawable.draw_pixbuf (gc.gdkGC, pb, 0, 0,
252252
int(x), int(y), imw, imh,
253253
gdk.RGB_DITHER_NONE, 0, 0)
254254
except AttributeError:
255+
# deprecated in 2.2
255256
pb.render_to_drawable(self.gdkDrawable, gc.gdkGC, 0, 0,
256257
int(x), int(y), imw, imh,
257258
gdk.RGB_DITHER_NONE, 0, 0)

0 commit comments

Comments
 (0)