Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 55c266c

Browse filesBrowse files
committed
MNT: set the family to rcParam value in init
1 parent b079583 commit 55c266c
Copy full SHA for 55c266c

File tree

Expand file treeCollapse file tree

1 file changed

+10
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-5
lines changed

‎lib/matplotlib/font_manager.py

Copy file name to clipboardExpand all lines: lib/matplotlib/font_manager.py
+10-5Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ def __init__(self,
681681
fname = None, # if this is set, it's a hardcoded filename to use
682682
_init = None # used only by copy()
683683
):
684-
self._family = None
684+
self._family = _normalize_font_family(rcParams['font.family'])
685685
self._slant = rcParams['font.style']
686686
self._variant = rcParams['font.variant']
687687
self._weight = rcParams['font.weight']
@@ -820,10 +820,7 @@ def set_family(self, family):
820820
"""
821821
if family is None:
822822
family = rcParams['font.family']
823-
if is_string_like(family):
824-
family = [six.text_type(family)]
825-
elif not is_string_like(family) and isinstance(family, Iterable):
826-
family = [six.text_type(f) for f in family]
823+
family = _normalize_font_family(family)
827824
self._family = family
828825
set_name = set_family
829826

@@ -967,6 +964,14 @@ def pickle_load(filename):
967964
return data
968965

969966

967+
def _normalize_font_family(family):
968+
if is_string_like(family):
969+
family = [six.text_type(family)]
970+
elif (not is_string_like(family) and isinstance(family, Iterable)):
971+
family = [six.text_type(f) for f in family]
972+
return family
973+
974+
970975
class TempCache(object):
971976
"""
972977
A class to store temporary caches that are (a) not saved to disk

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.