Skip to content

Commit a435aa1

Browse files
authored
Merge branch 'main' into chore/remove-pytest-x
2 parents 975f83e + 7bc29aa commit a435aa1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ultraplot/axes/base.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,14 +1886,16 @@ def _get_size_inches(self):
18861886
Return the width and height of the axes in inches.
18871887
"""
18881888
width, height = self.figure.get_size_inches()
1889-
bbox = self.get_position()
1889+
bbox = self.get_position(original=True)
18901890
width = width * abs(bbox.width)
18911891
height = height * abs(bbox.height)
1892-
dpi = getattr(self.figure, "dpi", None)
1892+
fig = self.figure
1893+
dpi = getattr(fig, "_original_dpi", None)
1894+
if dpi is None:
1895+
dpi = getattr(fig, "dpi", None)
18931896
if dpi:
18941897
width = round(width * dpi) / dpi
18951898
height = round(height * dpi) / dpi
1896-
fig = self.figure
18971899
if fig is not None and getattr(fig, "_refnum", None) == self.number:
18981900
if getattr(fig, "_refwidth", None) is not None:
18991901
width = fig._refwidth

0 commit comments

Comments
 (0)