From f794ed69d99294e138b3b754cf41a4535c12c3b6 Mon Sep 17 00:00:00 2001 From: saranti Date: Tue, 14 Feb 2023 19:46:49 +1100 Subject: [PATCH] Correct position of the mathtext accent --- lib/matplotlib/_mathtext.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/_mathtext.py b/lib/matplotlib/_mathtext.py index b41dca9d6988..ad30a5173634 100644 --- a/lib/matplotlib/_mathtext.py +++ b/lib/matplotlib/_mathtext.py @@ -2160,6 +2160,8 @@ def accent(self, s, loc, toks): accent_box.shrink() accent_box.shrink() centered = HCentered([Hbox(sym.width / 4.0), accent_box]) + while isinstance(sym, Hlist): + sym = sym.children[0] centered.hpack(sym.width, 'exactly') return Vlist([ centered,