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

Skip to content

Commit 4100e90

Browse files
authored
Merge pull request #11548 from timhoffm/numpydoc-parameter-choices
DOC: Use numpydoc-style parameter lists for choices
2 parents 2fc375b + 10c04ca commit 4100e90

File tree

7 files changed

+30
-27
lines changed

7 files changed

+30
-27
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid',
757757
758758
colors : array_like of colors, optional, default: 'k'
759759
760-
linestyles : ['solid' | 'dashed' | 'dashdot' | 'dotted'], optional
760+
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, optional
761761
762762
label : string, optional, default: ''
763763
@@ -835,7 +835,7 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
835835
836836
colors : array_like of colors, optional, default: 'k'
837837
838-
linestyles : ['solid' | 'dashed' | 'dashdot' | 'dotted'], optional
838+
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, optional
839839
840840
label : string, optional, default: ''
841841

lib/matplotlib/axes/_base.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ def set_position(self, pos, which='both'):
845845
pos : [left, bottom, width, height] or `~matplotlib.transforms.Bbox`
846846
The new position of the in `.Figure` coordinates.
847847
848-
which : ['both' | 'active' | 'original'], optional
848+
which : {'both', 'active', 'original'}, optional
849849
Determines which position variables to change.
850850
851851
"""
@@ -1210,7 +1210,7 @@ def set_aspect(self, aspect, adjustable=None, anchor=None, share=False):
12101210
12111211
Parameters
12121212
----------
1213-
aspect : ['auto' | 'equal'] or num
1213+
aspect : {'auto', 'equal'} or num
12141214
Possible values:
12151215
12161216
======== ================================================
@@ -1223,7 +1223,7 @@ def set_aspect(self, aspect, adjustable=None, anchor=None, share=False):
12231223
aspect='equal'.
12241224
======== ================================================
12251225
1226-
adjustable : None or ['box' | 'datalim'], optional
1226+
adjustable : None or {'box', 'datalim'}, optional
12271227
If not ``None``, this defines which parameter will be adjusted to
12281228
meet the required aspect. See `.set_adjustable` for further
12291229
details.
@@ -1284,7 +1284,7 @@ def set_adjustable(self, adjustable, share=False):
12841284
12851285
Parameters
12861286
----------
1287-
adjustable : ['box' | 'datalim']
1287+
adjustable : {'box', 'datalim'}
12881288
If 'box', change the physical dimensions of the Axes.
12891289
If 'datalim', change the ``x`` or ``y`` data limits.
12901290
@@ -2313,7 +2313,7 @@ def autoscale(self, enable=True, axis='both', tight=None):
23132313
True (default) turns autoscaling on, False turns it off.
23142314
None leaves the autoscaling state unchanged.
23152315
2316-
axis : ['both' | 'x' | 'y'], optional
2316+
axis : {'both', 'x', 'y'}, optional
23172317
which axis to operate on; default is 'both'
23182318
23192319
tight: bool or None, optional
@@ -2782,7 +2782,7 @@ def locator_params(self, axis='both', tight=None, **kwargs):
27822782
27832783
Parameters
27842784
----------
2785-
axis : ['both' | 'x' | 'y'], optional
2785+
axis : {'both', 'x', 'y'}, optional
27862786
The axis on which to operate.
27872787
27882788
tight : bool or None, optional

lib/matplotlib/collections.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ def set_capstyle(self, cs):
557557
558558
Parameters
559559
----------
560-
cs : ['butt' | 'round' | 'projecting']
560+
cs : {'butt', 'round', 'projecting'}
561561
The capstyle
562562
"""
563563
if cs in ('butt', 'round', 'projecting'):
@@ -575,7 +575,7 @@ def set_joinstyle(self, js):
575575
576576
Parameters
577577
----------
578-
js : ['miter' | 'round' | 'bevel']
578+
js : {'miter', 'round', 'bevel'}
579579
The joinstyle
580580
"""
581581
if js in ('miter', 'round', 'bevel'):
@@ -1568,28 +1568,32 @@ class EllipseCollection(Collection):
15681568
@docstring.dedent_interpd
15691569
def __init__(self, widths, heights, angles, units='points', **kwargs):
15701570
"""
1571-
*widths*: sequence
1572-
lengths of first axes (e.g., major axis lengths)
1571+
Parameters
1572+
----------
1573+
widths : array-like
1574+
The lengths of the first axes (e.g., major axis lengths).
15731575
1574-
*heights*: sequence
1575-
lengths of second axes
1576+
heights : array-like
1577+
The lengths of second axes.
15761578
1577-
*angles*: sequence
1578-
angles of first axes, degrees CCW from the X-axis
1579+
angles : array-like
1580+
The angles of the first axes, degrees CCW from the x-axis.
15791581
1580-
*units*: ['points' | 'inches' | 'dots' | 'width' | 'height'
1581-
| 'x' | 'y' | 'xy']
1582+
units : {'points', 'inches', 'dots', 'width', 'height', 'x', 'y', 'xy'}
15821583
1583-
units in which majors and minors are given; 'width' and
1584+
The units in which majors and minors are given; 'width' and
15841585
'height' refer to the dimensions of the axes, while 'x'
15851586
and 'y' refer to the *offsets* data units. 'xy' differs
15861587
from all others in that the angle as plotted varies with
15871588
the aspect ratio, and equals the specified angle only when
15881589
the aspect ratio is unity. Hence it behaves the same as
15891590
the :class:`~matplotlib.patches.Ellipse` with
1590-
axes.transData as its transform.
1591+
``axes.transData`` as its transform.
15911592
1592-
Additional kwargs inherited from the base :class:`Collection`:
1593+
Other Parameters
1594+
----------------
1595+
**kwargs
1596+
Additional kwargs inherited from the base :class:`Collection`.
15931597
15941598
%(Collection)s
15951599
"""

lib/matplotlib/legend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ def set_draggable(self, state, use_blit=False, update='loc'):
11261126
use_blit : bool, optional
11271127
Use blitting for faster image composition. For details see
11281128
:ref:`func-animation`.
1129-
update : ['loc' | 'bbox'], optional
1129+
update : {'loc', 'bbox'}, optional
11301130
The legend parameter to be changed when dragged:
11311131
11321132
- 'loc': update the *loc* parameter of the legend

lib/matplotlib/patches.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ def get_linewidth(self):
234234

235235
def get_linestyle(self):
236236
"""
237-
Return the linestyle. Will be one of ['solid' | 'dashed' |
238-
'dashdot' | 'dotted']
237+
Return the linestyle.
239238
"""
240239
return self._linestyle
241240

lib/matplotlib/scale.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def __init__(self, axis, **kwargs):
220220
*basex*/*basey*:
221221
The base of the logarithm
222222
223-
*nonposx*/*nonposy*: ['mask' | 'clip' ]
223+
*nonposx*/*nonposy*: {'mask', 'clip'}
224224
non-positive values in *x* or *y* can be masked as
225225
invalid, or clipped to a very small positive number
226226
@@ -507,7 +507,7 @@ class LogitScale(ScaleBase):
507507

508508
def __init__(self, axis, nonpos='mask'):
509509
"""
510-
*nonpos*: ['mask' | 'clip' ]
510+
*nonpos*: {'mask', 'clip'}
511511
values beyond ]0, 1[ can be masked as invalid, or clipped to a number
512512
very close to 0 or 1
513513
"""

lib/matplotlib/stackplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def stackplot(axes, x, *args,
2929
stackplot(x, y) # where y is MxN
3030
stackplot(x, y1, y2, y3, y4) # where y1, y2, y3, y4, are all 1xNm
3131
32-
baseline : ['zero' | 'sym' | 'wiggle' | 'weighted_wiggle']
32+
baseline : {'zero', 'sym', 'wiggle', 'weighted_wiggle'}
3333
Method used to calculate the baseline:
3434
3535
- ``'zero'``: Constant zero baseline, i.e. a simple stacked plot.

0 commit comments

Comments
 (0)