8000 Merge pull request #21479 from meeseeksmachine/auto-backport-of-pr-21… · matplotlib/matplotlib@428acc1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 428acc1

Browse files
authored
Merge pull request #21479 from meeseeksmachine/auto-backport-of-pr-21472-on-v3.5.x
Backport PR #21472 on branch v3.5.x (Clarify set_parse_math documentation.)
2 parents 329291f + 1f85036 commit 428acc1

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lib/matplotlib/text.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,8 @@ def _preprocess_math(self, s):
12321232
- If *self* is configured to use TeX, return *s* unchanged except that
12331233
a single space gets escaped, and the flag "TeX".
12341234
- Otherwise, if *s* is mathtext (has an even number of unescaped dollar
1235-
signs), return *s* and the flag True.
1235+
signs) and ``parse_math`` is not set to False, return *s* and the
1236+
flag True.
12361237
- Otherwise, return *s* with dollar signs unescaped, and the flag
12371238
False.
12381239
"""
@@ -1281,21 +1282,18 @@ def get_usetex(self):
12811282

12821283
def set_parse_math(self, parse_math):
12831284
"""
1284-
Override switch to enable/disable any mathtext
1285-
parsing for the given `Text` object.
1285+
Override switch to disable any mathtext parsing for this `Text`.
12861286
12871287
Parameters
12881288
----------
12891289
parse_math : bool
8B60
1290-
Whether to consider mathtext parsing for the string
1290+
If False, this `Text` will never use mathtext. If True, mathtext
1291+
will be used if there is an even number of unescaped dollar signs.
12911292
"""
12921293
self._parse_math = bool(parse_math)
12931294

12941295
def get_parse_math(self):
1295-
"""
1296-
Return whether mathtext parsing is considered
1297-
for this `Text` object.
1298-
"""
1296+
"""Return whether mathtext parsing is considered for this `Text`."""
12991297
return self._parse_math
13001298

13011299
def set_fontname(self, fontname):

0 commit comments

Comments
 (0)
0