Skip to content

Commit d8d05ce

Browse files
committed
Use raw docstrings
1 parent 3a7a47a commit d8d05ce

File tree

12 files changed

+34
-33
lines changed

12 files changed

+34
-33
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7114,7 +7114,7 @@ def psd(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
71147114
def csd(self, x, y, NFFT=None, Fs=None, Fc=None, detrend=None,
71157115
window=None, noverlap=None, pad_to=None,
71167116
sides=None, scale_by_freq=None, return_line=None, **kwargs):
7117-
"""
7117+
r"""
71187118
Plot the cross-spectral density.
71197119
71207120
The cross spectral density :math:`P_{xy}` by Welch's average
@@ -7181,7 +7181,7 @@ def csd(self, x, y, NFFT=None, Fs=None, Fc=None, detrend=None,
71817181
Notes
71827182
-----
71837183
For plotting, the power is plotted as
7184-
:math:`10\\log_{10}(P_{xy})` for decibels, though `P_{xy}` itself
7184+
:math:`10 \log_{10}(P_{xy})` for decibels, though `P_{xy}` itself
71857185
is returned.
71867186
71877187
References
@@ -7459,15 +7459,15 @@ def phase_spectrum(self, x, Fs=None, Fc=None, window=None,
74597459
def cohere(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
74607460
window=mlab.window_hanning, noverlap=0, pad_to=None,
74617461
sides='default', scale_by_freq=None, **kwargs):
7462-
"""
7462+
r"""
74637463
Plot the coherence between *x* and *y*.
74647464
74657465
Plot the coherence between *x* and *y*. Coherence is the
74667466
normalized cross spectral density:
74677467
74687468
.. math::
74697469
7470-
C_{xy} = \\frac{|P_{xy}|^2}{P_{xx}P_{yy}}
7470+
C_{xy} = \frac{|P_{xy}|^2}{P_{xx}P_{yy}}
74717471
74727472
Parameters
74737473
----------

lib/matplotlib/cbook/__init__.py

Lines 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

lib/matplotlib/colors.py

Lines 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

lib/matplotlib/docstring.py

Lines 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

lib/matplotlib/markers.py

Lines 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`.

lib/matplotlib/mathtext.py

Lines 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

lib/matplotlib/mlab.py

Lines 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
----------

lib/matplotlib/rcsetup.py

Lines 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):

lib/matplotlib/text.py

Lines 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
----------

lib/matplotlib/ticker.py

Lines 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

lib/matplotlib/widgets.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,10 +1724,11 @@ class SpanSelector(_SelectorWidget):
17241724
If True, the span stays visible after the mouse is released
17251725
17261726
button : int or list of ints
1727-
Determines which mouse buttons activate the span selector
1728-
1 = left mouse button\n
1729-
2 = center mouse button (scroll wheel)\n
1730-
3 = right mouse button\n
1727+
Determines which mouse buttons activate the span selector:
1728+
1729+
- 1: left mouse button
1730+
- 2: center mouse button (scroll wheel)
1731+
- 3: right mouse button
17311732
17321733
Examples
17331734
--------

lib/mpl_toolkits/axisartist/axislines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def get_label_pos(self, axes):
7676
return (x, y), trans
7777
7878
79-
def get_label_offset_transform(self, \
79+
def get_label_offset_transform(self,
8080
axes,
8181
pad_points, fontprops, renderer,
8282
bboxes,

0 commit comments

Comments
 (0)