@@ -199,7 +199,7 @@ def _get_unsampled_image(self, A, image_extents, viewlim):
199
199
im .is_grayscale = False
200
200
else :
201
201
if self ._rgbacache is None :
202
- x = self .to_rgba (self ._A , self . _alpha , bytes = True )
202
+ x = self .to_rgba (self ._A , bytes = True )
203
203
self ._rgbacache = x
204
204
else :
205
205
x = self ._rgbacache
@@ -345,6 +345,7 @@ def draw(self, renderer, *args, **kwargs):
345
345
gc = renderer .new_gc ()
346
346
gc .set_clip_rectangle (self .axes .bbox .frozen ())
347
347
gc .set_clip_path (self .get_clip_path ())
348
+ gc .set_alpha (self .get_alpha ())
348
349
349
350
if self ._check_unsampled_image (renderer ):
350
351
self ._draw_unsampled_image (renderer , gc )
@@ -722,7 +723,7 @@ def set_data(self, x, y, A):
722
723
A .shape = A .shape [0 :2 ]
723
724
if len (A .shape ) == 2 :
724
725
if A .dtype != np .uint8 :
725
- A = self .to_rgba (A , alpha = self . _alpha , bytes = True )
726
+ A = self .to_rgba (A , bytes = True )
726
727
self .is_grayscale = self .cmap .is_gray ()
727
728
else :
728
729
A = np .repeat (A [:,:,np .newaxis ], 4 , 2 )
@@ -824,7 +825,7 @@ def make_image(self, magnification=1.0):
824
825
width = width * magnification
825
826
height = height * magnification
826
827
if self ._rgbacache is None :
827
- A = self .to_rgba (self ._A , alpha = self . _alpha , bytes = True )
828
+ A = self .to_rgba (self ._A , bytes = True )
828
829
self ._rgbacache = A
829
830
if self ._A .ndim == 2 :
830
831
self .is_grayscale = self .cmap .is_gray ()
@@ -851,6 +852,7 @@ def draw(self, renderer, *args, **kwargs):
851
852
gc = renderer .new_gc ()
852
853
gc .set_clip_rectangle (self .axes .bbox .frozen ())
853
854
gc .set_clip_path (self .get_clip_path ())
855
+ gc .set_alpha (self .get_alpha ())
854
856
renderer .draw_image (gc ,
855
857
round (self .axes .bbox .xmin ),
856
858
round (self .axes .bbox .ymin ),
@@ -974,7 +976,7 @@ def make_image(self, magnification=1.0):
974
976
if self ._A is None :
975
977
raise RuntimeError ('You must first set the image array' )
976
978
977
- x = self .to_rgba (self ._A , self . _alpha , bytes = True )
979
+ x = self .to_rgba (self ._A , bytes = True )
978
980
self .magnification = magnification
979
981
# if magnification is not one, we need to resize
980
982
ismag = magnification != 1
@@ -1008,6 +1010,7 @@ def draw(self, renderer, *args, **kwargs):
1008
1010
gc = renderer .new_gc ()
1009
1011
gc .set_clip_rectangle (self .figure .bbox )
1010
1012
gc .set_clip_path (self .get_clip_path ())
1013
+ gc .set_alpha (self .get_alpha ())
1011
1014
renderer .draw_image (gc , round (self .ox ), round (self .oy ), im )
1012
1015
gc .restore ()
1013
1016
@@ -1096,7 +1099,7 @@ def make_image(self, renderer, magnification=1.0):
1096
1099
im .is_grayscale = False
1097
1100
else :
1098
1101
if self ._rgbacache is None :
1099
- x = self .to_rgba (self ._A , self . _alpha , bytes = True )
1102
+ x = self .to_rgba (self ._A , bytes = True )
1100
1103
self ._rgbacache = x
1101
1104
else :
1102
1105
x = self ._rgbacache
@@ -1148,6 +1151,7 @@ def draw(self, renderer, *args, **kwargs):
1148
1151
l , b , r , t = self .get_window_extent (renderer ).extents
1149
1152
gc = renderer .new_gc ()
1150
1153
self ._set_gc_clip (gc )
1154
+ gc .set_alpha (self .get_alpha ())
1151
1155
#gc.set_clip_path(self.get_clip_path())
1152
1156
renderer .draw_image (gc , round (l ), round (b ), im )
1153
1157
gc .restore ()
0 commit comments