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

Skip to content

Commit 34d6cc8

Browse files
committed
Simplify expression
1 parent fbb55c8 commit 34d6cc8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/cm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def to_rgba(self, x, alpha=None, bytes=False, norm=True):
267267
# For floating-point greyscale images, we treat negative as
268268
# transparent so we copy that over to the alpha channel
269269
if x.ndim == 2 and x.dtype.kind == 'f':
270-
rgba[:, :, 3] = np.where(x < 0.0, 0, rgba[:, :, 3])
270+
rgba[:, :, 3][x < 0.0] = 0
271271
return rgba
272272

273273
def set_array(self, A):

0 commit comments

Comments
 (0)