Menu

Commit [r6703]  Maximize  Restore  History

Document \mathdefault{} and \mathregular{} and the new mathtext.default rcParam.

mdboom 2008-12-26

changed /trunk/matplotlib/doc/users/mathtext.rst
/trunk/matplotlib/doc/users/mathtext.rst Diff Switch to side-by-side view
--- a/trunk/matplotlib/doc/users/mathtext.rst
+++ b/trunk/matplotlib/doc/users/mathtext.rst
@@ -144,9 +144,16 @@
 Fonts
 -----
 
-The default font is *italics* for mathematical symbols.  To change
-fonts, eg, to write "sin" in a Roman font, enclose the text in a font
-command::
+The default font is *italics* for mathematical symbols.
+
+.. note::
+
+   This default can be changed using the ``mathtext.default`` rcParam.
+   This is useful, for example, to use the same font as regular
+   non-math text for math text, by setting it to ``regular``.
+
+To change fonts, eg, to write "sin" in a Roman font, enclose the text
+in a font command::
 
     r'$s(t) = \mathcal{A}\mathrm{sin}(2 \omega t)$'
 
@@ -222,6 +229,12 @@
 ``stixsans``: **STIX sans-serif**
 
 .. image:: ../_static/stixsans_fontset.png
+
+Additionally, you can use ``\mathdefault{...}`` or its alias
+``\mathregular{...}`` to use the font used for regular text outside of
+mathtext.  There are a number of limitations to this approach, most
+notably that far fewer symbols will be available, but it can be useful
+to make math expressions blend well with other text in the plot.
 
 Custom fonts
 ~~~~~~~~~~~~
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.