8000 FIX: revert changes to gc calls · rmorshea/matplotlib@e301a11 · GitHub
[go: up one dir, main page]

Skip to content

Commit e301a11

Browse files
tacaswellrmorshea
authored andcommitted
FIX: revert changes to gc calls
graphics contexts have not been traitleted so need to still use `gc.set_alpha`
1 parent 8cd7878 commit e301a11

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/image.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def draw(self, renderer, *args, **kwargs):
383383
l, b, widthDisplay, heightDisplay = self.axes.bbox.bounds
384384
gc = renderer.new_gc()
385385
self._set_gc_clip(gc)
386-
gc.alpha = self.alpha
386+
gc.set_alpha(self.alpha)
387387

388388
if self._check_unsampled_image(renderer):
389389
self._draw_unsampled_image(renderer, gc)
@@ -935,7 +935,7 @@ def draw(self, renderer, *args, **kwargs):
935935
gc = renderer.new_gc()
936936
gc.set_clip_rectangle(self.axes.bbox.frozen())
937937
gc.set_clip_path(self.get_clip_path())
938-
gc.alpha = self.alpha
938+
gc.set_alpha(self.alpha)
939939
renderer.draw_image(gc,
940940
round(self.axes.bbox.xmin),
941941
round(self.axes.bbox.ymin),
@@ -1103,7 +1103,7 @@ def draw(self, renderer, *args, **kwargs):
11031103
gc = renderer.new_gc()
11041104
gc.set_clip_rectangle(self.figure.bbox)
11051105
gc.set_clip_path(self.get_clip_path())
1106-
gc.alpha = self.alpha
1106+
gc.set_alpha(self.alpha)
11071107
renderer.draw_image(gc, round(self.ox), round(self.oy), im)
11081108
gc.restore()
11091109
self.stale = False
@@ -1252,7 +1252,7 @@ def draw(self, renderer, *args, **kwargs):
12521252
x0, y0, x1, y1 = self.get_window_extent(renderer).extents
12531253
gc = renderer.new_gc()
12541254
self._set_gc_clip(gc)
1255-
gc.alpha = self.alpha
1255+
gc.set_alpha(self.alpha)
12561256

12571257
l = np.min([x0, x1])
12581258
b = np.min([y0, y1])

0 commit comments

Comments
 (0)
0