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

Skip to content

Fix imshow edges #8300

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 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
MNT: simplify creation of output array
  • Loading branch information
tacaswell committed Mar 14, 2017
commit 80909e5b7e5ff37218e99169fffeb321395e11cf
6 changes: 2 additions & 4 deletions lib/matplotlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,6 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
mask = A.mask
# ~A.mask # masked data
A = rgba
output = np.zeros((out_height, out_width, 4),
dtype=A.dtype)
alpha = 1.0
created_rgba_mask = True
else:
Expand All @@ -414,12 +412,12 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
elif A.shape[2] != 4:
raise ValueError("Invalid dimensions, got %s" % (A.shape,))

output = np.zeros((out_height, out_width, 4), dtype=A.dtype)

alpha = self.get_alpha()
if alpha is None:
alpha = 1.0

output = np.zeros((out_height, out_width, 4), dtype=A.dtype)

_image.resample(
A, output, t, _interpd_[self.get_interpolation()],
self.get_resample(), alpha,
Expand Down