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

Skip to content

Commit d21a6ed

Browse files
committed
Use output.shape
1 parent 8665697 commit d21a6ed

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/image.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,10 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
359359
subset = TransformedBbox(
360360
clip_bbox, t0.frozen().inverted()).frozen()
361361
output = output[
362-
int(max(subset.ymin, 0)):int(min(subset.ymax + 1, A.shape[0])),
363-
int(max(subset.xmin, 0)):int(min(subset.xmax + 1, A.shape[1]))]
362+
int(max(subset.ymin, 0)):
363+
int(min(subset.ymax + 1, output.shape[0])),
364+
int(max(subset.xmin, 0)):
365+
int(min(subset.xmax + 1, output.shape[1]))]
364366

365367
t = Affine2D().translate(
366368
int(max(subset.xmin, 0)), int(max(subset.ymin, 0))) + t

0 commit comments

Comments
 (0)