From e29d9b1bfa7f3377cd62ecf0c5aa8fea34597f05 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Mon, 24 Jan 2022 23:47:25 +0100 Subject: [PATCH] Backport PR #22306: FIX: ensure that used sub-packages are actually imported --- lib/matplotlib/ticker.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 3608dd062190..489cfbe8adc4 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -441,8 +441,9 @@ def __init__(self, useOffset=None, useMathText=None, useLocale=None): useMathText = mpl.rcParams['axes.formatter.use_mathtext'] if useMathText is False: try: - ufont = mpl.font_manager.findfont( - mpl.font_manager.FontProperties( + from matplotlib import font_manager + ufont = font_manager.findfont( + font_manager.FontProperties( mpl.rcParams["font.family"] ), fallback_to_default=False,