8000 FIX · matplotlib/matplotlib@f44136e · GitHub
[go: up one dir, main page]

Skip to content

Commit f44136e

Browse files
committed
FIX
1 parent 23d86ee commit f44136e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/matplotlib/backends/backend_ps.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,10 @@ def draw_image(self, gc, x, y, im, transform=None, true_size=None):
436436
return
437437
if true_size is not None:
438438
w, h = true_size
439-
w = int(w)
440-
h = int(h)
441439
print('HEY', h, w)
440+
w = int(w * self.image_magnification)
441+
h = int(h * self.image_magnification)
442+
print('HEY', h, w, self.image_magnification)
442443

443444

444445
imagecmd = "false 3 colorimage"
@@ -451,9 +452,11 @@ def draw_image(self, gc, x, y, im, transform=None, true_size=None):
451452
xscale = w / self.image_magnification
452453
yscale = h / self.image_magnification
453454
else:
454-
xscale = 1.0
455-
yscale = 1.0
455+
xscale = w / self.image_magnification
456+
yscale = h / self.image_magnification
456457
else:
458+
xscale = 1.0
459+
yscale = 1.0
457460
matrix = " ".join(map(str, transform.frozen().to_values()))
458461

459462
self._pswriter.write(f"""\

0 commit comments

Comments
 (0)
0