Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7114,7 +7114,7 @@ def psd(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
def csd(self, x, y, NFFT=None, Fs=None, Fc=None, detrend=None,
window=None, noverlap=None, pad_to=None,
sides=None, scale_by_freq=None, return_line=None, **kwargs):
"""
r"""
Plot the cross-spectral density.

The cross spectral density :math:`P_{xy}` by Welch's average
Expand Down Expand Up @@ -7181,7 +7181,7 @@ def csd(self, x, y, NFFT=None, Fs=None, Fc=None, detrend=None,
Notes
-----
For plotting, the power is plotted as
:math:`10\\log_{10}(P_{xy})` for decibels, though `P_{xy}` itself
:math:`10 \log_{10}(P_{xy})` for decibels, though `P_{xy}` itself
is returned.

References
Expand Down Expand Up @@ -7459,15 +7459,15 @@ def phase_spectrum(self, x, Fs=None, Fc=None, window=None,
def cohere(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
window=mlab.window_hanning, noverlap=0, pad_to=None,
sides='default', scale_by_freq=None, **kwargs):
"""
r"""
Plot the coherence between *x* and *y*.

Plot the coherence between *x* and *y*. Coherence is the
normalized cross spectral density:

.. math::

C_{xy} = \\frac{|P_{xy}|^2}{P_{xx}P_{yy}}
C_{xy} = \frac{|P_{xy}|^2}{P_{xx}P_{yy}}

Parameters
----------
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/cbook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ def _combine_masks(*args):

def boxplot_stats(X, whis=1.5, bootstrap=None, labels=None,
autorange=False):
"""
r"""
Returns list of dictionaries of statistics used to draw a series
of box and whisker plots. The `Returns` section enumerates the
required keys of the dictionary. Users can skip this function and
Expand Down Expand Up @@ -1095,7 +1095,7 @@ def boxplot_stats(X, whis=1.5, bootstrap=None, labels=None,

.. math::

\\mathrm{med} \\pm 1.57 \\times \\frac{\\mathrm{iqr}}{\\sqrt{N}}
\mathrm{med} \pm 1.57 \times \frac{\mathrm{iqr}}{\sqrt{N}}

General approach from:
McGill, R., Tukey, J.W., and Larsen, W.A. (1978) "Variations of
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2002,8 +2002,8 @@ def from_levels_and_colors(levels, colors, extend='neither'):

Returns
-------
(cmap, norm) : tuple containing a :class:`Colormap` and a \
:class:`Normalize` instance
cmap : `~matplotlib.colors.Normalize`
norm : `~matplotlib.colors.Colormap`
"""
colors_i0 = 0
colors_i1 = None
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/docstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def from_params(cls, params):

@cbook.deprecated("3.1")
class Appender:
"""
r"""
A function decorator that will append an addendum to the docstring
of the target function.

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/markers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
r"""
This module contains functions to handle markers. Used by both the
marker functionality of `~matplotlib.axes.Axes.plot` and
`~matplotlib.axes.Axes.scatter`.
Expand Down
12 changes: 6 additions & 6 deletions lib/matplotlib/mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def destroy(self):

def get_kern(self, font1, fontclass1, sym1, fontsize1,
font2, fontclass2, sym2, fontsize2, dpi):
"""
r"""
Get the kerning distance for font between *sym1* and *sym2*.

*fontX*: one of the TeX font names::
Expand All @@ -421,7 +421,7 @@ def get_kern(self, font1, fontclass1, sym1, fontsize1,

*fontclassX*: TODO

*symX*: a symbol in raw TeX form. e.g., '1', 'x' or '\\sigma'
*symX*: a symbol in raw TeX form. e.g., '1', 'x' or '\sigma'

*fontsizeX*: the fontsize in points

Expand All @@ -430,14 +430,14 @@ def get_kern(self, font1, fontclass1, sym1, fontsize1,
return 0.

def get_metrics(self, font, font_class, sym, fontsize, dpi, math=True):
"""
r"""
*font*: one of the TeX font names::

tt, it, rm, cal, sf, bf or default/regular (non-math)

*font_class*: TODO

*sym*: a symbol in raw TeX form. e.g., '1', 'x' or '\\sigma'
*sym*: a symbol in raw TeX form. e.g., '1', 'x' or '\sigma'

*fontsize*: font size in points

Expand Down Expand Up @@ -1647,13 +1647,13 @@ def kern(self):
# return 0.0

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

- *w*: specifies a width
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/mlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,13 +1071,13 @@ def specgram(x, NFFT=None, Fs=None, detrend=None, window=None,
@docstring.dedent_interpd
def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
noverlap=0, pad_to=None, sides='default', scale_by_freq=None):
"""
r"""
The coherence between *x* and *y*. Coherence is the normalized
cross spectral density:

.. math::

C_{xy} = \\frac{|P_{xy}|^2}{P_{xx}P_{yy}}
C_{xy} = \frac{|P_{xy}|^2}{P_{xx}P_{yy}}

Parameters
----------
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,10 +730,10 @@ def __call__(self, s):


def validate_hatch(s):
"""
r"""
Validate a hatch pattern.
A hatch pattern string can have any sequence of the following
characters: ``\\ / | - + * . x o O``.
characters: ``\ / | - + * . x o O``.

"""
if not isinstance(s, str):
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -1137,10 +1137,10 @@ def set_verticalalignment(self, align):
self.stale = True

def set_text(self, s):
"""
r"""
Set the text string *s*.

It may contain newlines (``\\n``) or math in LaTeX syntax.
It may contain newlines (``\n``) or math in LaTeX syntax.

Parameters
----------
Expand Down
12 changes: 6 additions & 6 deletions lib/matplotlib/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ class EngFormatter(Formatter):

def __init__(self, unit="", places=None, sep=" ", *, usetex=None,
useMathText=None):
"""
r"""
Parameters
----------
unit : str (default: "")
Expand All @@ -1242,9 +1242,9 @@ def __init__(self, unit="", places=None, sep=" ", *, usetex=None,
other useful options may be:

* ``sep=""`` to append directly the prefix/unit to the value;
* ``sep="\\N{THIN SPACE}"`` (``U+2009``);
* ``sep="\\N{NARROW NO-BREAK SPACE}"`` (``U+202F``);
* ``sep="\\N{NO-BREAK SPACE}"`` (``U+00A0``).
* ``sep="\N{THIN SPACE}"`` (``U+2009``);
* ``sep="\N{NARROW NO-BREAK SPACE}"`` (``U+202F``);
* ``sep="\N{NO-BREAK SPACE}"`` (``U+00A0``).

usetex : bool (default: None)
To enable/disable the use of TeX's math mode for rendering the
Expand Down Expand Up @@ -1441,11 +1441,11 @@ def convert_to_pct(self, x):

@property
def symbol(self):
"""
r"""
The configured percent symbol as a string.

If LaTeX is enabled via :rc:`text.usetex`, the special characters
``{'#', '$', '%', '&', '~', '_', '^', '\\', '{', '}'}`` are
``{'#', '$', '%', '&', '~', '_', '^', '\', '{', '}'}`` are
automatically escaped in the string.
"""
symbol = self._symbol
Expand Down
9 changes: 5 additions & 4 deletions lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1724,10 +1724,11 @@ class SpanSelector(_SelectorWidget):
If True, the span stays visible after the mouse is released

button : int or list of ints
Determines which mouse buttons activate the span selector
1 = left mouse button\n
2 = center mouse button (scroll wheel)\n
3 = right mouse button\n
Determines which mouse buttons activate the span selector:

- 1: left mouse button
- 2: center mouse button (scroll wheel)
- 3: right mouse button

Examples
--------
Expand Down
2 changes: 1 addition & 1 deletion lib/mpl_toolkits/axisartist/axislines.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def get_label_pos(self, axes):
return (x, y), trans


def get_label_offset_transform(self, \
def get_label_offset_transform(self,
axes,
pad_points, fontprops, renderer,
bboxes,
Expand Down