Skip to content

Commit 07f7ec6

Browse files
committed
FIX: bury import of matplotlib.font_manager
We need to ensure that the sub-module matplotlib.font_manager is imported when it is used in SclarFormater, however if we import it at the top level we will get circular imports. closes #22305
1 parent fd51e05 commit 07f7ec6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/ticker.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,9 @@ def __init__(self, useOffset=None, useMathText=None, useLocale=None):
441441
useMathText = mpl.rcParams['axes.formatter.use_mathtext']
442442
if useMathText is False:
443443
try:
444-
ufont = mpl.font_manager.findfont(
445-
mpl.font_manager.FontProperties(
444+
from matplotlib import font_manager
445+
ufont = font_manager.findfont(
446+
font_manager.FontProperties(
446447
mpl.rcParams["font.family"]
447448
),
448449
fallback_to_default=False,

0 commit comments

Comments
 (0)