MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_math_fontfamily

Method set_math_fontfamily

lib/matplotlib/font_manager.py:1081–1106  ·  view source on GitHub ↗

Set the font family for text in math mode. If not set explicitly, :rc:`mathtext.fontset` will be used. Parameters ---------- fontfamily : str The name of the font family. Available font families are defined in the :ref:`

(self, fontfamily)

Source from the content-addressed store, hash-verified

1079 return self._math_fontfamily
1080
1081 def set_math_fontfamily(self, fontfamily):
1082 """
1083 Set the font family for text in math mode.
1084
1085 If not set explicitly, :rc:`mathtext.fontset` will be used.
1086
1087 Parameters
1088 ----------
1089 fontfamily : str
1090 The name of the font family.
1091
1092 Available font families are defined in the
1093 :ref:`default matplotlibrc file <customizing-with-matplotlibrc-files>`.
1094
1095 See Also
1096 --------
1097 .text.Text.get_math_fontfamily
1098 """
1099 if fontfamily is None:
1100 fontfamily = mpl.rcParams['mathtext.fontset']
1101 else:
1102 valid_fonts = _validators['mathtext.fontset'].valid.values()
1103 # _check_in_list() Validates the parameter math_fontfamily as
1104 # if it were passed to rcParams['mathtext.fontset']
1105 _api.check_in_list(valid_fonts, math_fontfamily=fontfamily)
1106 self._math_fontfamily = fontfamily
1107
1108 def __copy__(self):
1109 # Bypass __init__ for speed, since values are already validated

Callers 1

__init__Method · 0.95

Calls 1

valuesMethod · 0.80

Tested by

no test coverage detected