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

Skip to content

Commit 139c045

Browse files
authored
Merge pull request #25704 from jklymak/fix-dont-round-unsampled
FIX: don't round image sizes to pixel if meant to be unsampled
2 parents 7fdf772 + 6704bff commit 139c045

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
@@ -405,7 +405,7 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
405405
# So that the image is aligned with the edge of the axes, we want to
406406
# round up the output width to the next integer. This also means
407407
# scaling the transform slightly to account for the extra subpixel.
408-
if (t.is_affine and round_to_pixel_border and
408+
if ((not unsampled) and t.is_affine and round_to_pixel_border and
409409
(out_width_base % 1.0 != 0.0 or out_height_base % 1.0 != 0.0)):
410410
out_width = math.ceil(out_width_base)
411411
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)