Skip to content

Commit 5037eef

Browse files
Struan-Murrayanntzer
authored andcommitted
Fix warning when legend is added while using TeX.
Fixes matplotlib#17518. Co-authored-by: Antony Lee <[email protected]>
1 parent c035f66 commit 5037eef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/offsetbox.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,8 @@ def get_window_extent(self, renderer):
881881

882882
def get_extent(self, renderer):
883883
_, h_, d_ = renderer.get_text_width_height_descent(
884-
"lp", self._text._fontproperties, ismath=False)
884+
"lp", self._text._fontproperties,
885+
ismath="TeX" if self._text.get_usetex() else False)
885886

886887
bbox, info, d = self._text._get_layout(renderer)
887888
w, h = bbox.width, bbox.height

0 commit comments

Comments
 (0)