8000 Merge pull request #17129 from timhoffm/doc-default · matplotlib/matplotlib@44aa425 · GitHub
[go: up one dir, main page]

Skip to content

Commit 44aa425

Browse files
authored
Merge pull request #17129 from timhoffm/doc-default
In docs remove 'optional' if 'default' can be given
2 parents 2f32371 + 0af8ebd commit 44aa425

File tree

18 files changed

+68
-68
lines changed

18 files changed

+68
-68
lines changed

examples/lines_bars_and_markers/filled_step.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def stack_hist(ax, stacked_data, sty_cycle, bottoms=None,
9292
sty_cycle : Cycler or operable of dict
9393
Style to apply to each set
9494
95-
bottoms : array, optional, default: 0
95+
bottoms : array, default: 0
9696
The initial positions of the bottoms.
9797
9898
hist_func : callable, optional

lib/matplotlib/animation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def setup(self, fig, outfile, dpi=None):
209209
The figure object that contains the information for frames.
210210
outfile : str
211211
The filename of the resulting movie file.
212-
dpi : float, optional, default: ``fig.dpi``
212+
dpi : float, default: ``fig.dpi``
213213
The DPI (or resolution) for the file. This controls the size
214214
in pixels of the resulting movie file.
215215
"""
@@ -992,7 +992,7 @@ class to use, such as 'ffmpeg'.
992992
Controls the dots per inch for the movie frames. Together with
993993
the figure's size in inches, this controls the size of the movie.
994994
995-
codec : str, optional, default: :rc:`animation.codec`.
995+
codec : str, default: :rc:`animation.codec`.
996996
The video codec to use. Not all codecs are supported by a given
997997
`MovieWriter`.
998998

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6833,12 +6833,12 @@ def hist2d(self, x, y, bins=10, range=None, density=False, weights=None,
68336833
weights : array-like, shape (n, ), optional
68346834
An array of values w_i weighing each sample (x_i, y_i).
68356835
6836-
cmin : scalar, optional, default: None
6836+
cmin : scalar, default: None
68376837
All bins that has count less than cmin will not be displayed (set
68386838
to NaN before passing to imshow) and these count values in the
68396839
return value count histogram will also be set to nan upon return.
68406840
6841-
cmax : scalar, optional, default: None
6841+
cmax : scalar, default: None
68426842
All bins that has count more than cmax will not be displayed (set
68436843
to NaN before passing to imshow) and these count values in the
68446844
return value count histogram will also be set to nan upon return.

lib/matplotlib/axes/_base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,8 @@ def __init__(self, fig, rect,
455455
The x or y `~.matplotlib.axis` is shared with the x or
456456
y axis in the input `~.axes.Axes`.
457457
458-
frameon : bool, optional
459-
True means that the axes frame is visible.
458+
frameon : bool, default: True
459+
Whether the axes frame is visible.
460460
461461
box_aspect : None, or a number, optional
462462
Sets the aspect of the axes box. See `~.axes.Axes.set_box_aspect`
@@ -906,7 +906,7 @@ def set_position(self, pos, which='both'):
906906
pos : [left, bottom, width, height] or `~matplotlib.transforms.Bbox`
907907
The new position of the in `.Figure` coordinates.
908908
909-
which : {'both', 'active', 'original'}, optional
909+
which : {'both', 'active', 'original'}, default: 'both'
910910
Determines which position variables to change.
911911
912912
"""

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,11 +2317,11 @@ def key_press_handler(event, canvas=None, toolbar=None):
23172317
----------
23182318
event : `KeyEvent`
23192319
A key press/release event.
2320-
canvas : `FigureCanvasBase`, optional, default: ``event.canvas``
2320+
canvas : `FigureCanvasBase`, default: ``event.canvas``
23212321
The backend-specific canvas instance. This parameter is kept for
23222322
back-compatibility, but, if set, should always be equal to
23232323
``event.canvas``.
2324-
toolbar : `NavigationToolbar2`, optional, default: ``event.canvas.toolbar``
2324+
toolbar : `NavigationToolbar2`, default: ``event.canvas.toolbar``
23252325
The navigation cursor toolbar. This parameter is kept for
23262326
back-compatibility, but, if set, should always be equal to
23272327
``event.canvas.toolbar``.

lib/matplotlib/backends/backend_pgf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ def __init__(self, filename, *, keep_empty=True, metadata=None):
10041004
filename : str or path-like
10051005
Plots using `PdfPages.savefig` will be written to a file at this
10061006
location. Any older file with the same name is overwritten.
1007-
keep_empty : bool, optional
1007+
keep_empty : bool, default: True
10081008
If set to False, then empty pdf files will be deleted automatically
10091009
when closed.
10101010
metadata : dict, optional

lib/matplotlib/backends/qt_editor/_formlayout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def __init__(self, data, comment="", with_margin=False, parent=None):
218218
The data to be edited in the form.
219219
comment : str, optional
220220
221-
with_margin : bool, optional, default: False
221+
with_margin : bool, default: False
222222
If False, the form elements reach to the border of the widget.
223223
This is the desired behavior if the FormWidget is used as a widget
224224
alongside with other widgets such as a QComboBox, which also do

lib/matplotlib/collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ def __init__(self, segments, # Can be None.
12991299
antialiaseds : sequence, optional
13001300
A sequence of ones or zeros.
13011301
1302-
linestyles : str or tuple, optional
1302+
linestyles : str or tuple, default: 'solid'
13031303
Either one of {'solid', 'dashed', 'dashdot', 'dotted'}, or
13041304
a dash tuple. The dash tuple is::
13051305

lib/matplotlib/colors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,9 +1955,9 @@ def blend_hsv(self, rgb, intensity, hsv_max_sat=None, hsv_max_val=None,
19551955
An MxNx3 RGB array of floats ranging from 0 to 1 (color image).
19561956
intensity : ndarray
19571957
An MxNx1 array of floats ranging from 0 to 1 (grayscale image).
1958-
hsv_max_sat : number, optional, default: 1
1958+
hsv_max_sat : number, default: 1
19591959
The maximum saturation value that the *intensity* map can shift the
1960-
output image to. Defaults to 1.
1960+
output image to.
19611961
hsv_min_sat : number, optional
19621962
The minimum saturation value that the *intensity* map can shift the
19631963
output image to. Defaults to 0.

lib/matplotlib/markers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ def __init__(self, marker=None, fillstyle=None):
213213
214214
Parameters
215215
----------
216-
marker : str or array-like, optional, default: None
216+
marker : str or array-like, default: None
217217
See the descriptions of possible markers in the module docstring.
218218
219-
fillstyle : str, optional, default: 'full'
220-
'full', 'left", 'right', 'bottom', 'top', 'none'
219+
fillstyle : str, default: 'full'
220+
One of 'full', 'left', 'right', 'bottom', 'top', 'none'.
221221
"""
222222
self._marker_function = None
223223
self.set_fillstyle(fillstyle)

lib/matplotlib/mlab.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ def _single_spectrum_helper(
640640
choose one of the functions: 'none' calls `.detrend_none`. 'mean' calls
641641
`.detrend_mean`. 'linear' calls `.detrend_linear`.
642642
643-
scale_by_freq : bool, optional, default: True
643+
scale_by_freq : bool, default: True
644644
Whether the resulting density values should be scaled by the scaling
645645
frequency, which gives density in units of Hz^-1. This allows for
646646
integration over the returned frequency values. The default is True for
@@ -850,7 +850,7 @@ def specgram(x, NFFT=None, Fs=None, detrend=None, window=None,
850850
noverlap : int, optional
851851
The number of points of overlap between blocks. The default
852852
value is 128.
853-
mode : str, optional, default: 'psd'
853+
mode : str, default: 'psd'
854854
What sort of spectrum to use:
855855
'psd'
856856
Returns the power spectral density.

lib/matplotlib/patches.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ def __init__(self, xy, width, height, angle=0, **kwargs):
13871387
Total length (diameter) of horizontal axis.
13881388
height : float
13891389
Total length (diameter) of vertical axis.
1390-
angle : scalar, optional
1390+
angle : float, default: 0
13911391
Rotation in degrees anti-clockwise.
13921392
13931393
Notes
@@ -1580,7 +1580,7 @@ def __init__(self, xy, width, height, angle=0.0,
15801580
angle : float
15811581
Rotation of the ellipse in degrees (counterclockwise).
15821582
1583-
theta1, theta2 : float, optional
1583+
theta1, theta2 : float, default: 0, 360
15841584
Starting and ending angles of the arc in degrees. These values
15851585
are relative to *angle*, e.g. if *angle* = 45 and *theta1* = 90
15861586
the absolute starting angle is 135.

lib/matplotlib/projections/polar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ def set_theta_zero_location(self, loc, offset=0.0):
10701070
loc : str
10711071
May be one of "N", "NW", "W", "SW", "S", "SE", "E", or "NE".
10721072
1073-
offset : float, optional
1073+
offset : float, default: 0
10741074
An offset in degrees to apply from the specified *loc*. **Note:**
10751075
this offset is *always* applied counter-clockwise regardless of
10761076
the direction setting.

lib/matplotlib/transforms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ def update_from_path(self, path, ignore=None, updatex=True, updatey=True):
858858
- when ``False``, include the existing bounds of the `Bbox`.
859859
- when ``None``, use the last value passed to :meth:`ignore`.
860860
861-
updatex, updatey : bool, optional
861+
updatex, updatey : bool, default: True
862862
When ``True``, update the x/y values.
863863
"""
864864
if ignore is None:
@@ -895,7 +895,7 @@ def update_from_data_xy(self, xy, ignore=None, updatex=True, updatey=True):
895895
- When ``False``, include the existing bounds of the `Bbox`.
896896
- When ``None``, use the last value passed to :meth:`ignore`.
897897
898-
updatex, updatey : bool, optional
898+
updatex, updatey : bool, default: True
899899
When ``True``, update the x/y values.
900900
"""
901901
if len(xy) == 0:

lib/matplotlib/widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2470,7 +2470,7 @@ class PolygonSelector(_SelectorWidget):
24702470
When a polygon is completed or modified after completion,
24712471
the *onselect* function is called and passed a list of the vertices as
24722472
``(xdata, ydata)`` tuples.
2473-
useblit : bool, optional
2473+
useblit : bool, default: False
24742474
lineprops : dict, default: \
24752475
``dict(color='k', linestyle='-', linewidth=2, alpha=0.5)``.
24762476
Artist properties for the line representing the edges of the polygon.

lib/mpl_toolkits/axes_grid1/anchored_artists.py

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ def __init__(self, width, height, xdescent, ydescent,
4242
'upper center' : 9,
4343
'center' : 10
4444
45-
pad : float, optional, default: 0.4
45+
pad : float, default: 0.4
4646
Padding around the child objects, in fraction of the font size.
4747
48-
borderpad : float, optional, default: 0.5
48+
borderpad : float, default: 0.5
4949
Border padding, in fraction of the font size.
5050
5151
prop : `matplotlib.font_manager.FontProperties`, optional
5252
Font property used as a reference for paddings.
5353
54-
frameon : bool, optional, default: True
54+
frameon : bool, default: True
5555
If True, draw a box around this artists.
5656
5757
**kwargs
@@ -113,16 +113,16 @@ def __init__(self, transform, loc,
113113
'upper center' : 9,
114114
'center' : 10
115115
116-
pad : float, optional, default: 0.4
116+
pad : float, default: 0.4
117117
Padding around the child objects, in fraction of the font size.
118118
119-
borderpad : float, optional, default: 0.5
119+
borderpad : float, default: 0.5
120120
Border padding, in fraction of the font size.
121121
122122
prop : `matplotlib.font_manager.FontProperties`, optional
123123
Font property used as a reference for paddings.
124124
125-
frameon : bool, optional, default: True
125+
frameon : bool, default: True
126126
If True, draw a box around this artists.
127127
128128
**kwargs
@@ -190,10 +190,10 @@ def __init__(self, transform, width, height, angle, loc,
190190
Padding around the ellipse, in fraction of the font size. Defaults
191191
to 0.1.
192192
193-
borderpad : float, optional, default: 0.1
193+
borderpad : float, default: 0.1
194194
Border padding, in fraction of the font size.
195195
196-
frameon : bool, optional, default: True
196+
frameon : bool, default: True
197197
If True, draw a box around the ellipse.
198198
199199
prop : `matplotlib.font_manager.FontProperties`, optional
@@ -254,27 +254,27 @@ def __init__(self, transform, size, label, loc,
254254
'upper center' : 9,
255255
'center' : 10
256256
257-
pad : float, optional, default: 0.1
257+
pad : float, default: 0.1
258258
Padding around the label and size bar, in fraction of the font
259259
size.
260260
261-
borderpad : float, optional, default: 0.1
261+
borderpad : float, default: 0.1
262262
Border padding, in fraction of the font size.
263263
264-
sep : float, optional, default: 2
264+
sep : float, default: 2
265265
Separation between the label and the size bar, in points.
266266
267-
frameon : bool, optional, default: True
267+
frameon : bool, default: True
268268
If True, draw a box around the horizontal bar and label.
269269
270-
size_vertical : float, optional, default: 0
270+
size_vertical : float, default: 0
271271
Vertical length of the size bar, given in coordinates of
272272
*transform*.
273273
274-
color : str, optional, default: 'black'
274+
color : str, default: 'black'
275275
Color for the size bar and label.
276276
277-
label_top : bool, optional, default: False
277+
label_top : bool, default: False
278278
If True, the label will be over the size bar.
279279
280280
fontproperties : `matplotlib.font_manager.FontProperties`, optional
@@ -381,13 +381,13 @@ def __init__(self, transform, label_x, label_y, length=0.15,
381381
label_x, label_y : str
382382
Label text for the x and y arrows
383383
384-
length : float, optional, default: 0.15
384+
length : float, default: 0.15
385385
Length of the arrow, given in coordinates of *transform*.
386386
387-
fontsize : float, optional, default: 0.08
387+
fontsize : float, default: 0.08
388388
Size of label strings, given in coordinates of *transform*.
389389
390-
loc : int, optional, default: 2
390+
loc : int, default: 2
391391
Location of the direction arrows. Valid location codes are::
392392
393393
'upper right' : 1,
@@ -401,45 +401,45 @@ def __init__(self, transform, label_x, label_y, length=0.15,
401401
'upper center' : 9,
402402
'center' : 10
403403
404-
angle : float, optional, default: 0
404+
angle : float, default: 0
405405
The angle of the arrows in degrees.
406406
407-
aspect_ratio : float, optional, default: 1
407+
aspect_ratio : float, default: 1
408408
The ratio of the length of arrow_x and arrow_y.
409409
Negative numbers can be used to change the direction.
410410
411-
pad : float, optional, default: 0.4
411+
pad : float, default: 0.4
412412
Padding around the labels and arrows, in fraction of the font size.
413413
414-
borderpad : float, optional, default: 0.4
414+
borderpad : float, default: 0.4
415415
Border padding, in fraction of the font size.
416416
417-
frameon : bool, optional, default: False
417+
frameon : bool, default: False
418418
If True, draw a box around the arrows and labels.
419419
420-
color : str, optional, default: 'white'
420+
color : str, default: 'white'
421421
Color for the arrows and labels.
422422
423-
alpha : float, optional, default: 1
423+
alpha : float, default: 1
424424
Alpha values of the arrows and labels
425425
426-
sep_x, sep_y : float, optional, default: 0.01 and 0 respectively
426+
sep_x, sep_y : float, default: 0.01 and 0 respectively
427427
Separation between the arrows and labels in coordinates of
428428
*transform*.
429429
430430
fontproperties : `matplotlib.font_manager.FontProperties`, optional
431431
Font properties for the label text.
432432
433-
back_length : float, optional, default: 0.15
433+
back_length : float, default: 0.15
434434
Fraction of the arrow behind the arrow crossing.
435435
436-
head_width : float, optional, default: 10
436+
head_width : float, default: 10
437437
Width of arrow head, sent to ArrowStyle.
438438
439-
head_length : float, optional, default: 15
439+
head_length : float, default: 15
440440
Length of arrow head, sent to ArrowStyle.
441441
442-
tail_width : float, optional, default: 2
442+
tail_width : float, default: 2
443443
Width of arrow tail, sent to ArrowStyle.
444444
445445
text_props, arrow_props : dict

0 commit comments

Comments
 (0)
0