Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d486c2

Browse files
authored
Merge pull request #14680 from timhoffm/parameter-formatting
DOC: Format parameters in descriptions with emph instead of backticks
2 parents f51bf2b + e0a1572 commit 0d486c2

28 files changed

+72
-73
lines changed

examples/axes_grid1/inset_locator_demo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# height and optionally a location (loc) that accepts locations as codes,
1212
# similar to `~matplotlib.axes.Axes.legend`.
1313
# By default, the inset is offset by some points from the axes,
14-
# controlled via the `borderpad` parameter.
14+
# controlled via the *borderpad* parameter.
1515

1616
import matplotlib.pyplot as plt
1717
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
@@ -44,11 +44,11 @@
4444

4545

4646
###############################################################################
47-
# The arguments `bbox_to_anchor` and `bbox_transfrom` can be used for a more
47+
# The arguments *bbox_to_anchor* and *bbox_transfrom* can be used for a more
4848
# fine grained control over the inset position and size or even to position
4949
# the inset at completely arbitrary positions.
50-
# The `bbox_to_anchor` sets the bounding box in coordinates according to the
51-
# `bbox_transform`.
50+
# The *bbox_to_anchor* sets the bounding box in coordinates according to the
51+
# *bbox_transform*.
5252
#
5353

5454
fig = plt.figure(figsize=[5.5, 2.8])

examples/statistics/confidence_ellipse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
def confidence_ellipse(x, y, ax, n_std=3.0, facecolor='none', **kwargs):
4242
"""
43-
Create a plot of the covariance confidence ellipse of `x` and `y`
43+
Create a plot of the covariance confidence ellipse of *x* and *y*.
4444
4545
Parameters
4646
----------

lib/matplotlib/_constrained_layout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ def layoutcolorbarsingle(ax, cax, shrink, aspect, location, pad=0.05):
515515
"""
516516
Do the layout for a colorbar, to not overly pollute colorbar.py
517517
518-
`pad` is in fraction of the original axis size.
518+
*pad* is in fraction of the original axis size.
519519
"""
520520
axlb = ax._layoutbox
521521
axpos = ax._poslayoutbox
@@ -604,7 +604,7 @@ def layoutcolorbargridspec(parents, cax, shrink, aspect, location, pad=0.05):
604604
"""
605605
Do the layout for a colorbar, to not overly pollute colorbar.py
606606
607-
`pad` is in fraction of the original axis size.
607+
*pad* is in fraction of the original axis size.
608608
"""
609609

610610
gs = parents[0].get_subplotspec().get_gridspec()

lib/matplotlib/_layoutbox.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,10 @@ def edit_width(self, width, strength='strong'):
319319
sol.suggestValue(self.width, width)
320320

321321
def constrain_width(self, width, strength='strong'):
322-
'''
323-
Constrain the width of the layout box. `width` is
322+
"""
323+
Constrain the width of the layout box. *width* is
324324
either a float or a layoutbox.width.
325-
'''
325+
"""
326326
c = (self.width == width)
327327
self.solver.addConstraint(c | strength)
328328

@@ -471,7 +471,7 @@ def __repr__(self):
471471
def hstack(boxes, padding=0, strength='strong'):
472472
'''
473473
Stack LayoutBox instances from left to right.
474-
`padding` is in figure-relative units.
474+
*padding* is in figure-relative units.
475475
'''
476476

477477
for i in range(1, len(boxes)):

lib/matplotlib/artist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ def set_figure(self, fig):
681681
if self.figure is fig:
682682
return
683683
# if we currently have a figure (the case of both `self.figure`
684-
# and `fig` being none is taken care of above) we then user is
684+
# and *fig* being none is taken care of above) we then user is
685685
# trying to change the figure an artist is associated with which
686686
# is not allowed for the same reason as adding the same instance
687687
# to more than one Axes
@@ -1518,7 +1518,7 @@ def setp(obj, *args, **kwargs):
15181518
... long output listing omitted
15191519
15201520
You may specify another output file to `setp` if `sys.stdout` is not
1521-
acceptable for some reason using the `file` keyword-only argument::
1521+
acceptable for some reason using the *file* keyword-only argument::
15221522
15231523
>>> with fopen('output.log') as f:
15241524
>>> setp(line, file=f)

lib/matplotlib/axes/_axes.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def set_title(self, label, fontdict=None, loc=None, pad=None,
160160
161161
fontdict : dict
162162
A dictionary controlling the appearance of the title text,
163-
the default `fontdict` is::
163+
the default *fontdict* is::
164164
165165
{'fontsize': rcParams['axes.titlesize'],
166166
'fontweight' : rcParams['axes.titleweight'],
@@ -723,7 +723,7 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
723723
... verticalalignment='center', transform=ax.transAxes)
724724
725725
You can put a rectangular box around the text instance (e.g., to
726-
set a background color) by using the keyword `bbox`. `bbox` is
726+
set a background color) by using the keyword *bbox*. *bbox* is
727727
a dictionary of `~matplotlib.patches.Rectangle`
728728
properties. For example::
729729
@@ -967,8 +967,8 @@ def axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs):
967967
"""
968968
Add a vertical span (rectangle) across the axes.
969969
970-
Draw a vertical span (rectangle) from `xmin` to `xmax`. With
971-
the default values of `ymin` = 0 and `ymax` = 1. This always
970+
Draw a vertical span (rectangle) from *xmin* to *xmax*. With
971+
the default values of *ymin* = 0 and *ymax* = 1. This always
972972
spans the yrange, regardless of the ylim settings, even if you
973973
change them, e.g., with the :meth:`set_ylim` command. That is,
974974
the vertical extent is in axes coords: 0=bottom, 0.5=middle,
@@ -3680,7 +3680,7 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
36803680
# if non-default sym value, put it into the flier dictionary
36813681
# the logic for providing the default symbol ('b+') now lives
36823682
# in bxp in the initial value of final_flierprops
3683-
# handle all of the `sym` related logic here so we only have to pass
3683+
# handle all of the *sym* related logic here so we only have to pass
36843684
# on the flierprops dict.
36853685
if sym is not None:
36863686
# no-flier case, which should really be done with
@@ -6351,12 +6351,12 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
63516351
If an integer is given, ``bins + 1`` bin edges are calculated and
63526352
returned, consistent with `numpy.histogram`.
63536353
6354-
If `bins` is a sequence, gives bin edges, including left edge of
6355-
first bin and right edge of last bin. In this case, `bins` is
6354+
If *bins* is a sequence, gives bin edges, including left edge of
6355+
first bin and right edge of last bin. In this case, *bins* is
63566356
returned unmodified.
63576357
63586358
All but the last (righthand-most) bin is half-open. In other
6359-
words, if `bins` is::
6359+
words, if *bins* is::
63606360
63616361
[1, 2, 3, 4]
63626362
@@ -7911,7 +7911,7 @@ def violin(self, vpstats, positions=None, vert=True, widths=0.5,
79117911
showmeans=False, showextrema=True, showmedians=False):
79127912
"""Drawing function for violin plots.
79137913
7914-
Draw a violin plot for each column of `vpstats`. Each filled area
7914+
Draw a violin plot for each column of *vpstats*. Each filled area
79157915
extends to represent the entire data range, with optional lines at the
79167916
mean, the median, the minimum, the maximum, and the quantiles values.
79177917

lib/matplotlib/axes/_base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3387,7 +3387,7 @@ def get_xticklabels(self, minor=False, which=None):
33873387
else return the major ticklabels.
33883388
33893389
which : None, ('minor', 'major', 'both')
3390-
Overrides `minor`.
3390+
Overrides *minor*.
33913391
33923392
Selects which ticklabels to return
33933393
@@ -3411,7 +3411,7 @@ def set_xticklabels(self, labels, fontdict=None, minor=False, **kwargs):
34113411
34123412
fontdict : dict, optional
34133413
A dictionary controlling the appearance of the ticklabels.
3414-
The default `fontdict` is::
3414+
The default *fontdict* is::
34153415
34163416
{'fontsize': rcParams['axes.titlesize'],
34173417
'fontweight': rcParams['axes.titleweight'],
@@ -3770,7 +3770,7 @@ def get_yticklabels(self, minor=False, which=None):
37703770
else return the major ticklabels
37713771
37723772
which : None, ('minor', 'major', 'both')
3773-
Overrides `minor`.
3773+
Overrides *minor*.
37743774
37753775
Selects which ticklabels to return
37763776
@@ -3794,7 +3794,7 @@ def set_yticklabels(self, labels, fontdict=None, minor=False, **kwargs):
37943794
37953795
fontdict : dict, optional
37963796
A dictionary controlling the appearance of the ticklabels.
3797-
The default `fontdict` is::
3797+
The default *fontdict* is::
37983798
37993799
{'fontsize': rcParams['axes.titlesize'],
38003800
'fontweight': rcParams['axes.titleweight'],

lib/matplotlib/axis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,7 @@ def get_ticklabels(self, minor=False, which=None):
12951295
else return the major ticklabels
12961296
12971297
which : None, ('minor', 'major', 'both')
1298-
Overrides `minor`.
1298+
Overrides *minor*.
12991299
13001300
Selects which ticklabels to return
13011301

lib/matplotlib/backend_bases.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,9 @@ def draw_image(self, gc, x, y, im, transform=None):
481481
form of a :class:`~matplotlib.transforms.Affine2DBase` instance.
482482
The translation vector of the transformation is given in physical
483483
units (i.e., dots or pixels). Note that the transformation does not
484-
override `x` and `y`, and has to be applied *before* translating
485-
the result by `x` and `y` (this can be accomplished by adding `x`
486-
and `y` to the translation vector defined by `transform`).
484+
override *x* and *y*, and has to be applied *before* translating
485+
the result by *x* and *y* (this can be accomplished by adding *x*
486+
and *y* to the translation vector defined by *transform*).
487487
"""
488488
raise NotImplementedError
489489

@@ -1000,10 +1000,10 @@ def get_sketch_params(self):
10001000
10011001
A 3-tuple with the following elements:
10021002
1003-
* `scale`: The amplitude of the wiggle perpendicular to the
1003+
* ``scale``: The amplitude of the wiggle perpendicular to the
10041004
source line.
1005-
* `length`: The length of the wiggle along the line.
1006-
* `randomness`: The scale factor by which the length is
1005+
* ``length``: The length of the wiggle along the line.
1006+
* ``randomness``: The scale factor by which the length is
10071007
shrunken or expanded.
10081008
10091009
May return `None` if no sketch parameters were set.

lib/matplotlib/backend_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class ToolBase:
7575
Filename of the image
7676
7777
**String**: Filename of the image to use in the toolbar. If None, the
78-
`name` is used as a label in the toolbar button
78+
*name* is used as a label in the toolbar button
7979
"""
8080

8181
def __init__(self, toolmanager, name):

lib/matplotlib/backends/backend_pgf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
10751075
def close(self):
10761076
"""
10771077
Finalize this object, running LaTeX in a temporary directory
1078-
and moving the final pdf file to `filename`.
1078+
and moving the final pdf file to *filename*.
10791079
"""
10801080
self._file.write(rb'\end{document}\n')
10811081
self._file.close()

lib/matplotlib/backends/qt_editor/figureoptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ def cmp_key(label):
7878
def prepare_data(d, init):
7979
"""Prepare entry for FormLayout.
8080
81-
`d` is a mapping of shorthands to style names (a single style may
81+
*d* is a mapping of shorthands to style names (a single style may
8282
have multiple shorthands, in particular the shorthands `None`,
83-
`"None"`, `"none"` and `""` are synonyms); `init` is one shorthand
83+
`"None"`, `"none"` and `""` are synonyms); *init* is one shorthand
8484
of the initial style.
8585
8686
This function returns an list suitable for initializing a

lib/matplotlib/cbook/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ def boxplot_stats(X, whis=1.5, bootstrap=None, labels=None,
10831083
10841084
labels : array-like, optional
10851085
Labels for each dataset. Length must be compatible with
1086-
dimensions of `X`.
1086+
dimensions of *X*.
10871087
10881088
autorange : bool, optional (False)
10891089
When `True` and the data are distributed such that the 25th and 75th
@@ -1478,7 +1478,7 @@ def pts_to_prestep(x, *args):
14781478
>>> x_s, y1_s, y2_s = pts_to_prestep(x, y1, y2)
14791479
"""
14801480
steps = np.zeros((1 + len(args), max(2 * len(x) - 1, 0)))
1481-
# In all `pts_to_*step` functions, only assign *once* using `x` and `args`,
1481+
# In all `pts_to_*step` functions, only assign once using *x* and *args*,
14821482
# as converting to an array may be expensive.
14831483
steps[0, 0::2] = x
14841484
steps[0, 1::2] = steps[0, 0:-2:2]

lib/matplotlib/dates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def _from_ordinalf(x, tz=None):
291291
'expects datetime objects.'.format(ix))
292292
dt = datetime.datetime.fromordinal(ix).replace(tzinfo=UTC)
293293

294-
# Since the input date `x` float is unable to preserve microsecond
294+
# Since the input date *x* float is unable to preserve microsecond
295295
# precision of time representation in non-antique years, the
296296
# resulting datetime is rounded to the nearest multiple of
297297
# `musec_prec`. A value of 20 is appropriate for current dates.

lib/matplotlib/legend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def _update_bbox_to_anchor(self, loc_in_canvas):
185185
Controls the font size of the legend. If the value is numeric the
186186
size will be the absolute font size in points. String values are
187187
relative to the current default font size. This argument is only
188-
used if `prop` is not specified.
188+
used if *prop* is not specified.
189189
190190
numpoints : None or int
191191
The number of marker points in the legend when creating a legend
@@ -254,7 +254,7 @@ def _update_bbox_to_anchor(self, loc_in_canvas):
254254
:rc:`axes.edgecolor`.
255255
256256
mode : {"expand", None}
257-
If `mode` is set to ``"expand"`` the legend will be horizontally
257+
If *mode* is set to ``"expand"`` the legend will be horizontally
258258
expanded to fill the axes area (or `bbox_to_anchor` if defines
259259
the legend's size).
260260

lib/matplotlib/mlab.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,11 +1427,11 @@ class GaussianKDE:
14271427
the covariance matrix is multiplied.
14281428
14291429
covariance : ndarray
1430-
The covariance matrix of `dataset`, scaled by the calculated bandwidth
1430+
The covariance matrix of *dataset*, scaled by the calculated bandwidth
14311431
(`kde.factor`).
14321432
14331433
inv_cov : ndarray
1434-
The inverse of `covariance`.
1434+
The inverse of *covariance*.
14351435
14361436
Methods
14371437
-------

lib/matplotlib/path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ def contains_point(self, point, transform=None, radius=0.0):
460460
if transform is not None:
461461
transform = transform.frozen()
462462
# `point_in_path` does not handle nonlinear transforms, so we
463-
# transform the path ourselves. If `transform` is affine, letting
463+
# transform the path ourselves. If *transform* is affine, letting
464464
# `point_in_path` handle the transform avoids allocating an extra
465465
# buffer.
466466
if transform and not transform.is_affine:

lib/matplotlib/patheffects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def __init__(self, offset=(2, -2),
292292
shadow_color : color
293293
The shadow color. Default is black.
294294
A value of ``None`` takes the original artist's color
295-
with a scale factor of `rho`.
295+
with a scale factor of *rho*.
296296
alpha : float
297297
The alpha transparency of the created shadow patch.
298298
Default is 0.3.

lib/matplotlib/pyplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def figure(num=None, # autoincrement if None, else integer from 1-N
445445
it active, and returns a reference to it. If this figure does not
446446
exists, create it and returns it.
447447
If num is a string, the window title will be set to this figure's
448-
`num`.
448+
*num*.
449449
450450
figsize : (float, float), optional, default: None
451451
width, height in inches. If not provided, defaults to

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
inserted. This is usually useful with the ``:context:`` option.
7272
7373
Additionally, this directive supports all of the options of the `image`
74-
directive, except for `target` (since plot will add its own target). These
74+
directive, except for *target* (since plot will add its own target). These
7575
include `alt`, `height`, `width`, `scale`, `align` and `class`.
7676
7777
Configuration options

lib/matplotlib/streamplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def shape(self):
352352
def within_grid(self, xi, yi):
353353
"""Return True if point is a valid index of grid."""
354354
# Note that xi/yi can be floats; so, for example, we can't simply check
355-
# `xi < self.nx` since `xi` can be `self.nx - 1 < xi < self.nx`
355+
# `xi < self.nx` since *xi* can be `self.nx - 1 < xi < self.nx`
356356
return xi >= 0 and xi <= self.nx - 1 and yi >= 0 and yi <= self.ny - 1
357357

358358

lib/matplotlib/testing/compare.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424

2525
def make_test_filename(fname, purpose):
2626
"""
27-
Make a new filename by inserting `purpose` before the file's
28-
extension.
27+
Make a new filename by inserting *purpose* before the file's extension.
2928
"""
3029
base, ext = os.path.splitext(fname)
3130
return '%s-%s%s' % (base, purpose, ext)

lib/matplotlib/testing/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def cleanup(style=None):
5656
The name of the style to apply.
5757
"""
5858

59-
# If cleanup is used without arguments, `style` will be a callable, and we
59+
# If cleanup is used without arguments, *style* will be a callable, and we
6060
# pass it directly to the wrapper generator. If cleanup if called with an
6161
# argument, it is a string naming a style, and the function will be passed
6262
# as an argument to what we return. This is a confusing, but somewhat

lib/matplotlib/tests/test_artist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def test_setp():
238238
martist.setp(chain(lines1, lines2), 'lw', 5)
239239
plt.setp(ax.spines.values(), color='green')
240240

241-
# Check `file` argument
241+
# Check *file* argument
242242
sio = io.StringIO()
243243
plt.setp(lines1, 'zorder', file=sio)
244244
assert sio.getvalue() == ' zorder: float\n'

0 commit comments

Comments
 (0)