Skip to content

Allow array alpha for imshow #8183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Prev Previous commit
Next Next commit
Only restore alpha channel if _array_alpha is given.
  • Loading branch information
tillahoffmann committed Mar 3, 2017
commit c9c96abc21dfe71b27761d31a96ca68c148d85f7
2 changes: 1 addition & 1 deletion lib/matplotlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
output = self.to_rgba(output, bytes=True, norm=False)

# Restore the alpha channel
if created_rgba_mask:
if created_rgba_mask and self._array_alpha is not None:
output[..., 3] = (output[..., 3] * hid_output[..., 3]).astype(
output.dtype
)
Expand Down