@@ -432,15 +432,13 @@ def draw_image(self, gc, x, y, im, transform=None, true_size=None):
432
432
# docstring inherited
433
433
434
434
h , w = im .shape [:2 ]
435
+ print ('PRE' , h , w )
436
+
435
437
if h == 0 or w == 0 :
436
438
return
437
439
if true_size is not None :
438
- w , h = true_size
439
- 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 )
443
-
440
+ w0 , h0 = true_size
441
+ print ('HEY' , w , h , w0 , h0 , self .image_magnification )
444
442
445
443
imagecmd = "false 3 colorimage"
446
444
data = im [::- 1 , :, :3 ] # Vertically flipped rgb values.
@@ -452,8 +450,9 @@ def draw_image(self, gc, x, y, im, transform=None, true_size=None):
452
450
xscale = w / self .image_magnification
453
451
yscale = h / self .image_magnification
454
452
else :
455
- xscale = w / self .image_magnification
456
- yscale = h / self .image_magnification
453
+ xscale = w0
454
+ yscale = h0
455
+ print ('scale' , xscale , yscale )
457
456
else :
458
457
xscale = 1.0
459
458
yscale = 1.0
@@ -462,9 +461,9 @@ def draw_image(self, gc, x, y, im, transform=None, true_size=None):
462
461
self ._pswriter .write (f"""\
463
462
gsave
464
463
{ self ._get_clip_cmd (gc )}
465
- { x :g } { y :g } translate
464
+ { x :.2f } { y :.2f } translate
466
465
[{ matrix } ] concat
467
- { xscale :g } { yscale :g } scale
466
+ { xscale :.2f } { yscale :.2f } scale
468
467
/DataString { w :d} string def
469
468
{ w :d} { h :d} 8 [ { w :d} 0 0 -{ h :d} 0 { h :d} ]
470
469
{{
0 commit comments