Skip to content

Commit 9fe97bd

Browse files
committed
Access figure width and height through bbox
1 parent 0172451 commit 9fe97bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plotnine/_mpl/layout_manager/_layout_items.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def axis_text_x_margin(self, ax: Axes) -> Iterator[float]:
308308
# the axis_text.
309309
major, minor = [], []
310310
if not self._is_blank("axis_text_x"):
311-
h = self.plot.figure.get_figheight() * 72
311+
h = self.plot.figure.bbox.height
312312
major = [
313313
(t.get_pad() or 0) / h for t in ax.xaxis.get_major_ticks()
314314
]
@@ -325,7 +325,7 @@ def axis_text_y_margin(self, ax: Axes) -> Iterator[float]:
325325
# the axis_text.
326326
major, minor = [], []
327327
if not self._is_blank("axis_text_y"):
328-
w = self.plot.figure.get_figwidth() * 72
328+
w = self.plot.figure.bbox.width
329329
major = [
330330
(t.get_pad() or 0) / w for t in ax.yaxis.get_major_ticks()
331331
]

0 commit comments

Comments
 (0)