Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 30354dd

Browse filesBrowse files
authored
Merge pull request #14332 from timhoffm/raw-docstrings
Use raw docstrings instead of escaping backslashes
2 parents 3ae86f1 + d8d05ce commit 30354dd
Copy full SHA for 30354dd

File tree

Expand file treeCollapse file tree

12 files changed

+34
-33
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

12 files changed

+34
-33
lines changed
Open diff view settings
Collapse file

‎lib/matplotlib/axes/_axes.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7088,7 +7088,7 @@ def psd(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
70887088
def csd(self, x, y, NFFT=None, Fs=None, Fc=None, detrend=None,
70897089
window=None, noverlap=None, pad_to=None,
70907090
sides=None, scale_by_freq=None, return_line=None, **kwargs):
7091-
"""
7091+
r"""
70927092
Plot the cross-spectral density.
70937093
70947094
The cross spectral density :math:`P_{xy}` by Welch's average
@@ -7155,7 +7155,7 @@ def csd(self, x, y, NFFT=None, Fs=None, Fc=None, detrend=None,
71557155
Notes
71567156
-----
71577157
For plotting, the power is plotted as
7158-
:math:`10\\log_{10}(P_{xy})` for decibels, though `P_{xy}` itself
7158+
:math:`10 \log_{10}(P_{xy})` for decibels, though `P_{xy}` itself
71597159
is returned.
71607160
71617161
References
@@ -7433,15 +7433,15 @@ def phase_spectrum(self, x, Fs=None, Fc=None, window=None,
74337433
def cohere(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
74347434
window=mlab.window_hanning, noverlap=0, pad_to=None,
74357435
sides='default', scale_by_freq=None, **kwargs):
7436-
"""
7436+
r"""
74377437
Plot the coherence between *x* and *y*.
74387438
74397439
Plot the coherence between *x* and *y*. Coherence is the
74407440
normalized cross spectral density:
74417441
74427442
.. math::
74437443
7444-
C_{xy} = \\frac{|P_{xy}|^2}{P_{xx}P_{yy}}
7444+
C_{xy} = \frac{|P_{xy}|^2}{P_{xx}P_{yy}}
74457445
74467446
Parameters
74477447
----------
Collapse file

‎lib/matplotlib/cbook/__init__.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/cbook/__init__.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ def _combine_masks(*args):
10261026

10271027
def boxplot_stats(X, whis=1.5, bootstrap=None, labels=None,
10281028
autorange=False):
1029-
"""
1029+
r"""
10301030
Returns list of dictionaries of statistics used to draw a series
10311031
of box and whisker plots. The `Returns` section enumerates the
10321032
required keys of the dictionary. Users can skip this function and
@@ -1095,7 +1095,7 @@ def boxplot_stats(X, whis=1.5, bootstrap=None, labels=None,
10951095
10961096
.. math::
10971097
1098-
\\mathrm{med} \\pm 1.57 \\times \\frac{\\mathrm{iqr}}{\\sqrt{N}}
1098+
\mathrm{med} \pm 1.57 \times \frac{\mathrm{iqr}}{\sqrt{N}}
10991099
11001100
General approach from:
11011101
McGill, R., Tukey, J.W., and Larsen, W.A. (1978) "Variations of
Collapse file

‎lib/matplotlib/colors.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/colors.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,8 +2002,8 @@ def from_levels_and_colors(levels, colors, extend='neither'):
20022002
20032003
Returns
20042004
-------
2005-
(cmap, norm) : tuple containing a :class:`Colormap` and a \
2006-
:class:`Normalize` instance
2005+
cmap : `~matplotlib.colors.Normalize`
2006+
norm : `~matplotlib.colors.Colormap`
20072007
"""
20082008
colors_i0 = 0
20092009
colors_i1 = None
Collapse file

‎lib/matplotlib/docstring.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/docstring.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def from_params(cls, params):
6161

6262
@cbook.deprecated("3.1")
6363
class Appender:
64-
"""
64+
r"""
6565
A function decorator that will append an addendum to the docstring
6666
of the target function.
6767
Collapse file

‎lib/matplotlib/markers.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/markers.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""
1+
r"""
22
This module contains functions to handle markers. Used by both the
33
marker functionality of `~matplotlib.axes.Axes.plot` and
44
`~matplotlib.axes.Axes.scatter`.
Collapse file

‎lib/matplotlib/mathtext.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/mathtext.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def destroy(self):
412412

413413
def get_kern(self, font1, fontclass1, sym1, fontsize1,
414414
font2, fontclass2, sym2, fontsize2, dpi):
415-
"""
415+
r"""
416416
Get the kerning distance for font between *sym1* and *sym2*.
417417
418418
*fontX*: one of the TeX font names::
@@ -421,7 +421,7 @@ def get_kern(self, font1, fontclass1, sym1, fontsize1,
421421
422422
*fontclassX*: TODO
423423
424-
*symX*: a symbol in raw TeX form. e.g., '1', 'x' or '\\sigma'
424+
*symX*: a symbol in raw TeX form. e.g., '1', 'x' or '\sigma'
425425
426426
*fontsizeX*: the fontsize in points
427427
@@ -430,14 +430,14 @@ def get_kern(self, font1, fontclass1, sym1, fontsize1,
430430
return 0.
431431

432432
def get_metrics(self, font, font_class, sym, fontsize, dpi, math=True):
433-
"""
433+
r"""
434434
*font*: one of the TeX font names::
435435
436436
tt, it, rm, cal, sf, bf or default/regular (non-math)
437437
438438
*font_class*: TODO
439439
440-
*sym*: a symbol in raw TeX form. e.g., '1', 'x' or '\\sigma'
440+
*sym*: a symbol in raw TeX form. e.g., '1', 'x' or '\sigma'
441441
442442
*fontsize*: font size in points
443443
@@ -1647,13 +1647,13 @@ def kern(self):
16471647
# return 0.0
16481648

16491649
def hpack(self, w=0., m='additional'):
1650-
"""
1650+
r"""
16511651
The main duty of :meth:`hpack` is to compute the dimensions of
16521652
the resulting boxes, and to adjust the glue if one of those
16531653
dimensions is pre-specified. The computed sizes normally
16541654
enclose all of the material inside the new box; but some items
16551655
may stick out if negative glue is used, if the box is
1656-
overfull, or if a ``\\vbox`` includes other boxes that have
1656+
overfull, or if a ``\vbox`` includes other boxes that have
16571657
been shifted left.
16581658
16591659
- *w*: specifies a width
Collapse file

‎lib/matplotlib/mlab.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/mlab.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,13 +1071,13 @@ def specgram(x, NFFT=None, Fs=None, detrend=None, window=None,
10711071
@docstring.dedent_interpd
10721072
def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
10731073
noverlap=0, pad_to=None, sides='default', scale_by_freq=None):
1074-
"""
1074+
r"""
10751075
The coherence between *x* and *y*. Coherence is the normalized
10761076
cross spectral density:
10771077
10781078
.. math::
10791079
1080-
C_{xy} = \\frac{|P_{xy}|^2}{P_{xx}P_{yy}}
1080+
C_{xy} = \frac{|P_{xy}|^2}{P_{xx}P_{yy}}
10811081
10821082
Parameters
10831083
----------
Collapse file

‎lib/matplotlib/rcsetup.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/rcsetup.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,10 +730,10 @@ def __call__(self, s):
730730

731731

732732
def validate_hatch(s):
733-
"""
733+
r"""
734734
Validate a hatch pattern.
735735
A hatch pattern string can have any sequence of the following
736-
characters: ``\\ / | - + * . x o O``.
736+
characters: ``\ / | - + * . x o O``.
737737
738738
"""
739739
if not isinstance(s, str):
Collapse file

‎lib/matplotlib/text.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/text.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,10 +1137,10 @@ def set_verticalalignment(self, align):
11371137
self.stale = True
11381138

11391139
def set_text(self, s):
1140-
"""
1140+
r"""
11411141
Set the text string *s*.
11421142
1143-
It may contain newlines (``\\n``) or math in LaTeX syntax.
1143+
It may contain newlines (``\n``) or math in LaTeX syntax.
11441144
11451145
Parameters
11461146
----------
Collapse file

‎lib/matplotlib/ticker.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/ticker.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ class EngFormatter(Formatter):
12201220

12211221
def __init__(self, unit="", places=None, sep=" ", *, usetex=None,
12221222
useMathText=None):
1223-
"""
1223+
r"""
12241224
Parameters
12251225
----------
12261226
unit : str (default: "")
@@ -1242,9 +1242,9 @@ def __init__(self, unit="", places=None, sep=" ", *, usetex=None,
12421242
other useful options may be:
12431243
12441244
* ``sep=""`` to append directly the prefix/unit to the value;
1245-
* ``sep="\\N{THIN SPACE}"`` (``U+2009``);
1246-
* ``sep="\\N{NARROW NO-BREAK SPACE}"`` (``U+202F``);
1247-
* ``sep="\\N{NO-BREAK SPACE}"`` (``U+00A0``).
1245+
* ``sep="\N{THIN SPACE}"`` (``U+2009``);
1246+
* ``sep="\N{NARROW NO-BREAK SPACE}"`` (``U+202F``);
1247+
* ``sep="\N{NO-BREAK SPACE}"`` (``U+00A0``).
12481248
12491249
usetex : bool (default: None)
12501250
To enable/disable the use of TeX's math mode for rendering the
@@ -1441,11 +1441,11 @@ def convert_to_pct(self, x):
14411441

14421442
@property
14431443
def symbol(self):
1444-
"""
1444+
r"""
14451445
The configured percent symbol as a string.
14461446
14471447
If LaTeX is enabled via :rc:`text.usetex`, the special characters
1448-
``{'#', '$', '%', '&', '~', '_', '^', '\\', '{', '}'}`` are
1448+
``{'#', '$', '%', '&', '~', '_', '^', '\', '{', '}'}`` are
14491449
automatically escaped in the string.
14501450
"""
14511451
symbol = self._symbol

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.