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

Skip to content

Commit 2fe9e32

Browse files
committed
Merge pull request #5112 from Tillsten/patch-1
OffsetImage: use dpi_cor in get_extent
1 parent e4a7c01 commit 2fe9e32

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/matplotlib/offsetbox.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,8 +1334,6 @@ def get_window_extent(self, renderer):
13341334
return mtransforms.Bbox.from_bounds(ox - xd, oy - yd, w, h)
13351335

13361336
def get_extent(self, renderer):
1337-
1338-
# FIXME dpi_cor is never used
13391337
if self._dpi_cor: # True, do correction
13401338
dpi_cor = renderer.points_to_pixels(1.)
13411339
else:
@@ -1344,7 +1342,7 @@ def get_extent(self, renderer):
13441342
zoom = self.get_zoom()
13451343
data = self.get_data()
13461344
ny, nx = data.shape[:2]
1347-
w, h = nx * zoom, ny * zoom
1345+
w, h = dpi_cor * nx * zoom, dpi_cor * ny * zoom
13481346

13491347
return w, h, 0, 0
13501348

0 commit comments

Comments
 (0)