Skip to content

Commit 8d42212

Browse files
authored
Merge pull request #26211 from meeseeksmachine/auto-backport-of-pr-25704-on-v3.7.x
Backport PR #25704 on branch v3.7.x (FIX: don't round image sizes to pixel if meant to be unsampled)
2 parents 59e32b1 + 2329d95 commit 8d42212

20 files changed

+963
-695
lines changed

lib/matplotlib/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
398398
# So that the image is aligned with the edge of the axes, we want to
399399
# round up the output width to the next integer. This also means
400400
# scaling the transform slightly to account for the extra subpixel.
401-
if (t.is_affine and round_to_pixel_border and
401+
if ((not unsampled) and t.is_affine and round_to_pixel_border and
402402
(out_width_base % 1.0 != 0.0 or out_height_base % 1.0 != 0.0)):
403403
out_width = math.ceil(out_width_base)
404404
out_height = math.ceil(out_height_base)
Binary file not shown.
Binary file not shown.
Lines changed: 55 additions & 44 deletions
Loading
Binary file not shown.

0 commit comments

Comments
 (0)