Skip to content

Commit dc66735

Browse files
authored
Merge pull request #7465 from QuLogic/pixel-snapping
Round pixel snapping to actual next pixel
2 parents 59a4077 + d0a40c9 commit dc66735

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+614
-618
lines changed

lib/matplotlib/image.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,9 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
341341
# means scaling the transform just slightly to account for the
342342
# extra subpixel.
343343
if (t.is_affine and round_to_pixel_border and
344-
(out_width_base % 1.0 != 0.0 or
345-
out_height_base % 1.0 != 0.0)):
346-
out_width = int(ceil(out_width_base) + 1)
347-
out_height = int(ceil(out_height_base) + 1)
344+
(out_width_base % 1.0 != 0.0 or out_height_base % 1.0 != 0.0)):
345+
out_width = int(ceil(out_width_base))
346+
out_height = int(ceil(out_height_base))
348347
extra_width = (out_width - out_width_base) / out_width_base
349348
extra_height = (out_height - out_height_base) / out_height_base
350349
t += Affine2D().scale(
Binary file not shown.

lib/matplotlib/tests/baseline_images/test_axes/hist2d_transpose.svg

+26-26
Loading
Loading
Loading
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)