|
149 | 149 | # +---------------------+----------------------------------------------------+
|
150 | 150 | # | rcParam | usage |
|
151 | 151 | # +=====================+====================================================+
|
152 |
| -# | ``'font.family'`` | List of either names of font or ``{'cursive', | |
153 |
| -# | | 'fantasy', 'monospace', 'sans', 'sans serif', | |
154 |
| -# | | 'sans-serif', 'serif'}``. | |
| 152 | +# | ``'font.family'`` | List of font families (installed on user's machine)| |
| 153 | +# | | and/or ``{'cursive', 'fantasy', 'monospace', | |
| 154 | +# | | 'sans', 'sans serif', 'sans-serif', 'serif'}``. | |
155 | 155 | # | | |
|
156 | 156 | # +---------------------+----------------------------------------------------+
|
157 | 157 | # | ``'font.style'`` | The default style, ex ``'normal'``, |
|
|
174 | 174 | # | | this size. |
|
175 | 175 | # +---------------------+----------------------------------------------------+
|
176 | 176 | #
|
177 |
| -# The mapping between the family aliases (``{'cursive', 'fantasy', |
178 |
| -# 'monospace', 'sans', 'sans serif', 'sans-serif', 'serif'}``) and actual font names |
| 177 | +# Matplotlib can use font families installed on the user's computer, i.e. |
| 178 | +# Helvetica, Times, etc. Font families can also be specified with |
| 179 | +# generic-family aliases like (``{'cursive', 'fantasy', 'monospace', |
| 180 | +# 'sans', 'sans serif', 'sans-serif', 'serif'}``). |
| 181 | +# |
| 182 | +# The mapping between the generic family aliases and actual font families |
| 183 | +# (mentioned at :doc:`default rcParams </tutorials/introductory/customizing>`) |
179 | 184 | # is controlled by the following rcParams:
|
180 | 185 | #
|
181 | 186 | #
|
182 | 187 | # +------------------------------------------+--------------------------------+
|
183 |
| -# | family alias | rcParam with mappings | |
| 188 | +# | CSS-based generic-family alias | rcParam with mappings | |
184 | 189 | # +==========================================+================================+
|
185 | 190 | # | ``'serif'`` | ``'font.serif'`` |
|
186 | 191 | # +------------------------------------------+--------------------------------+
|
|
194 | 199 | # +------------------------------------------+--------------------------------+
|
195 | 200 | #
|
196 | 201 | #
|
197 |
| -# which are lists of font names. |
| 202 | +# If any of generic family names appear in ``'font.family'``, we replace that entry |
| 203 | +# by all the entries in the corresponding rcParam mapping. |
| 204 | +# For example: :: |
| 205 | +# |
| 206 | +# matplotlib.rcParams['font.family'] = ['Family1', 'serif', 'Family2'] |
| 207 | +# matplotlib.rcParams['font.serif'] = ['SerifFamily1', 'SerifFamily2'] |
| 208 | +# |
| 209 | +# # This is effectively translated to: |
| 210 | +# matplotlib.rcParams['font.family'] = ['Family1', 'SerifFamily1', 'SerifFamily2', 'Family2'] |
198 | 211 | #
|
199 | 212 | # Text with non-latin glyphs
|
200 | 213 | # ==========================
|
|
204 | 217 | # Korean, or Japanese.
|
205 | 218 | #
|
206 | 219 | # To set the default font to be one that supports the code points you
|
207 |
| -# need, prepend the font name to ``'font.family'`` or the desired alias |
208 |
| -# lists :: |
| 220 | +# need, prepend the font name to ``'font.family'`` (recommended), or to the |
| 221 | +# desired alias lists. :: |
| 222 | +# |
| 223 | +# # first method |
| 224 | +# matplotlib.rcParams['font.family'] = ['Source Han Sans TW', 'sans-serif'] |
| 225 | +# |
| 226 | +# # second method |
| 227 | +# matplotlib.rcParams['font.family'] = ['sans-serif'] |
| 228 | +# matplotlib.rcParams['sans-serif'] = ['Source Han Sans TW', ...] |
| 229 | +# |
| 230 | +# The generic family alias lists contain fonts that are either shipped |
| 231 | +# alongside Matplotlib (so they have 100% chance of being found), or fonts |
| 232 | +# which have a very high probability of being present in most systems. |
209 | 233 | #
|
210 |
| -# matplotlib.rcParams['font.sans-serif'] = ['Source Han Sans TW', 'sans-serif'] |
| 234 | +# A good practice when setting custom font families is to append |
| 235 | +# a generic-family to the font-family list as a last resort. |
211 | 236 | #
|
212 |
| -# or set it in your :file:`.matplotlibrc` file:: |
| 237 | +# You can also set it in your :file:`.matplotlibrc` file:: |
213 | 238 | #
|
214 |
| -# font.sans-serif: Source Han Sans TW, Arial, sans-serif |
| 239 | +# font.family: Source Han Sans TW, Arial, sans-serif |
215 | 240 | #
|
216 | 241 | # To control the font used on per-artist basis use the *name*, *fontname* or
|
217 | 242 | # *fontproperties* keyword arguments documented :doc:`above
|
|
0 commit comments