Bug summary
The FontProperties family parameter can be a generic family such as sans-serif and the actual font should be looked up in rcParams according to the documentation.
Code for reproduction
>>> import matplotlib as mpl
>>> import matplotlib.font_manager as fm
>>> mpl.rcParams["font.family"]
['sans-serif']
>>> mpl.rcParams["font.sans-serif"]
['DejaVu Sans',
'Bitstream Vera Sans',
'Computer Modern Sans Serif',
'Lucida Grande',
'Verdana',
'Geneva',
'Lucid',
'Arial',
'Helvetica',
'Avant Garde',
'sans-serif']
>>> fp = fm.FontProperties()
<matplotlib.font_manager.FontProperties at ...>
>>> fp.get_family()
['sans-serif']
Actual outcome
>>> fp.get_family()
['sans-serif']
Expected outcome
>>> fp.get_family()
['DejaVu Sans',
'Bitstream Vera Sans',
'Computer Modern Sans Serif',
'Lucida Grande',
'Verdana',
'Geneva',
'Lucid',
'Arial',
'Helvetica',
'Avant Garde',
'sans-serif']
Additional information
No response
Operating system
Windows
Matplotlib Version
3.5.2
Matplotlib Backend
TkAgg
Python version
3.9.13
Jupyter version
N/A
Installation
pip
Bug summary
The FontProperties family parameter can be a generic family such as sans-serif and the actual font should be looked up in rcParams according to the documentation.
Code for reproduction
Actual outcome
Expected outcome
Additional information
No response
Operating system
Windows
Matplotlib Version
3.5.2
Matplotlib Backend
TkAgg
Python version
3.9.13
Jupyter version
N/A
Installation
pip