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

Skip to content

Commit 48c5af8

Browse files
authored
Merge pull request #26753 from meeseeksmachine/auto-backport-of-pr-26705-on-v3.8.x
Backport PR #26705 on branch v3.8.x ([Doc] Small fixes found by velin)
2 parents cafd879 + cd18426 commit 48c5af8

13 files changed

+94
-52
lines changed

lib/matplotlib/_constrained_layout.py

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,8 @@ def do_constrained_layout(fig, h_pad, w_pad,
6969
7070
Parameters
7171
----------
72-
fig : Figure
73-
``Figure`` instance to do the layout in.
74-
75-
renderer : Renderer
76-
Renderer to use.
72+
fig : `~matplotlib.figure.Figure`
73+
`.Figure` instance to do the layout in.
7774
7875
h_pad, w_pad : float
7976
Padding around the axes elements in figure-normalized units.
@@ -274,7 +271,7 @@ def compress_fixed_aspect(layoutgrids, fig):
274271
extrah = np.zeros(gs.nrows)
275272
elif _gs != gs:
276273
raise ValueError('Cannot do compressed layout if axes are not'
277-
'all from the same gridspec')
274+
'all from the same gridspec')
278275
orig = ax.get_position(original=True)
279276
actual = ax.get_position(original=False)
280277
dw = orig.width - actual.width
@@ -343,6 +340,19 @@ def make_layout_margins(layoutgrids, fig, renderer, *, w_pad=0, h_pad=0,
343340
decorations on the axis.
344341
345342
Then make room for colorbars.
343+
344+
Parameters
345+
----------
346+
layoutgrids : dict
347+
fig : `~matplotlib.figure.Figure`
348+
`.Figure` instance to do the layout in.
349+
renderer : `~matplotlib.backend_bases.RendererBase` subclass.
350+
The renderer to use.
351+
w_pad, h_pad : float, default: 0
352+
Width and height padding (in fraction of figure).
353+
hspace, wspace : float, default: 0
354+
Width and height padding as fraction of figure size divided by
355+
number of columns or rows.
346356
"""
347357
for sfig in fig.subfigs: # recursively make child panel margins
348358
ss = sfig._subplotspec
@@ -448,7 +458,7 @@ def make_margin_suptitles(layoutgrids, fig, renderer, *, w_pad=0, h_pad=0):
448458
# get the h_pad and w_pad as distances in the local subfigure coordinates:
449459
padbox = mtransforms.Bbox([[0, 0], [w_pad, h_pad]])
450460
padbox = (fig.transFigure -
451-
fig.transSubfigure).transform_bbox(padbox)
461+
fig.transSubfigure).transform_bbox(padbox)
452462
h_pad_local = padbox.height
453463
w_pad_local = padbox.width
454464

@@ -578,7 +588,12 @@ def match_submerged_margins(layoutgrids, fig):
578588

579589
def get_cb_parent_spans(cbax):
580590
"""
581-
Figure out which subplotspecs this colorbar belongs to:
591+
Figure out which subplotspecs this colorbar belongs to.
592+
593+
Parameters
594+
----------
595+
cbax : `~matplotlib.axes.Axes`
596+
Axes for the colorbar.
582597
"""
583598
rowstart = np.inf
584599
rowstop = -np.inf
@@ -602,14 +617,14 @@ def get_pos_and_bbox(ax, renderer):
602617
603618
Parameters
604619
----------
605-
ax
606-
renderer
620+
ax : `~matplotlib.axes.Axes`
621+
renderer : `~matplotlib.backend_bases.RendererBase` subclass.
607622
608623
Returns
609624
-------
610-
pos : Bbox
625+
pos : `~matplotlib.transforms.Bbox`
611626
Position in figure coordinates.
612-
bbox : Bbox
627+
bbox : `~matplotlib.transforms.Bbox`
613628
Tight bounding box in figure coordinates.
614629
"""
615630
fig = ax.figure
@@ -672,18 +687,14 @@ def reposition_colorbar(layoutgrids, cbax, renderer, *, offset=None):
672687
673688
Parameters
674689
----------
675-
cbax : Axes
676-
Axes for the colorbar
677-
678-
renderer :
679-
w_pad, h_pad : float
680-
width and height padding (in fraction of figure)
681-
hspace, wspace : float
682-
width and height padding as fraction of figure size divided by
683-
number of columns or rows
684-
margin : array-like
685-
offset the colorbar needs to be pushed to in order to
686-
account for multiple colorbars
690+
layoutgrids : dict
691+
cbax : `~matplotlib.axes.Axes`
692+
Axes for the colorbar.
693+
renderer : `~matplotlib.backend_bases.RendererBase` subclass.
694+
The renderer to use.
695+
offset : array-like
696+
Offset the colorbar needs to be pushed to in order to
697+
account for multiple colorbars.
687698
"""
688699

689700
parents = cbax._colorbar_info['parents']
@@ -753,7 +764,7 @@ def reposition_colorbar(layoutgrids, cbax, renderer, *, offset=None):
753764

754765
def reset_margins(layoutgrids, fig):
755766
"""
756-
Reset the margins in the layoutboxes of fig.
767+
Reset the margins in the layoutboxes of *fig*.
757768
758769
Margins are usually set as a minimum, so if the figure gets smaller
759770
the minimum needs to be zero in order for it to grow again.

lib/matplotlib/backend_bases.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,15 @@ def draw_markers(self, gc, marker_path, marker_trans, path,
208208
----------
209209
gc : `.GraphicsContextBase`
210210
The graphics context.
211+
marker_path : `~matplotlib.path.Path`
212+
The path for the marker.
211213
marker_trans : `~matplotlib.transforms.Transform`
212214
An affine transform applied to the marker.
215+
path : `~matplotlib.path.Path`
216+
The locations to draw the markers.
213217
trans : `~matplotlib.transforms.Transform`
214218
An affine transform applied to the path.
219+
rgbFace : color, optional
215220
"""
216221
for vertices, codes in path.iter_segments(trans, simplify=False):
217222
if len(vertices):

lib/matplotlib/backends/_backend_pdf_ps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def get_glyphs_subset(fontfile, characters):
2828
2929
Parameters
3030
----------
31-
symbol : str
31+
fontfile : str
3232
Path to the font file
3333
characters : str
3434
Continuous set of characters to include in subset

lib/matplotlib/backends/backend_svg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ def end(self, tag=None, indent=True):
200200
tag
201201
Element tag. If given, the tag must match the start tag. If
202202
omitted, the current element is closed.
203+
indent : bool, default: True
203204
"""
204205
if tag:
205206
assert self.__tags, f"unbalanced end({tag})"

lib/matplotlib/colors.py

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2300,6 +2300,18 @@ def __init__(self, azdeg=315, altdeg=45, hsv_min_val=0, hsv_max_val=1,
23002300
altdeg : float, default: 45 degrees
23012301
The altitude (0-90, degrees up from horizontal) of the light
23022302
source.
2303+
hsv_min_val : number, default: 0
2304+
The minimum value ("v" in "hsv") that the *intensity* map can shift the
2305+
output image to.
2306+
hsv_max_val : number, default: 1
2307+
The maximum value ("v" in "hsv") that the *intensity* map can shift the
2308+
output image to.
2309+
hsv_min_sat : number, default: 1
2310+
The minimum saturation value that the *intensity* map can shift the output
2311+
image to.
2312+
hsv_max_sat : number, default: 0
2313+
The maximum saturation value that the *intensity* map can shift the output
2314+
image to.
23032315
23042316
Notes
23052317
-----
@@ -2599,18 +2611,20 @@ def blend_hsv(self, rgb, intensity, hsv_max_sat=None, hsv_max_val=None,
25992611
An (M, N, 3) RGB array of floats ranging from 0 to 1 (color image).
26002612
intensity : `~numpy.ndarray`
26012613
An (M, N, 1) array of floats ranging from 0 to 1 (grayscale image).
2602-
hsv_max_sat : number, default: 1
2603-
The maximum saturation value that the *intensity* map can shift the
2604-
output image to.
2614+
hsv_max_sat : number, optional
2615+
The maximum saturation value that the *intensity* map can shift the output
2616+
image to. If not provided, use the value provided upon initialization.
26052617
hsv_min_sat : number, optional
2606-
The minimum saturation value that the *intensity* map can shift the
2607-
output image to. Defaults to 0.
2618+
The minimum saturation value that the *intensity* map can shift the output
2619+
image to. If not provided, use the value provided upon initialization.
26082620
hsv_max_val : number, optional
2609-
The maximum value ("v" in "hsv") that the *intensity* map can shift
2610-
the output image to. Defaults to 1.
2621+
The maximum value ("v" in "hsv") that the *intensity* map can shift the
2622+
output image to. If not provided, use the value provided upon
2623+
initialization.
26112624
hsv_min_val : number, optional
2612-
The minimum value ("v" in "hsv") that the *intensity* map can shift
2613-
the output image to. Defaults to 0.
2625+
The minimum value ("v" in "hsv") that the *intensity* map can shift the
2626+
output image to. If not provided, use the value provided upon
2627+
initialization.
26142628
26152629
Returns
26162630
-------

lib/matplotlib/legend_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def create_artists(self, legend, orig_handle,
155155
fontsize : int
156156
The fontsize in pixels. The legend artists being created should
157157
be scaled according to the given fontsize.
158-
trans : `~matplotlib.transforms.Transform`
158+
trans : `~matplotlib.transforms.Transform`
159159
The transform that is applied to the legend artists being created.
160160
Typically from unit coordinates in the handler box to screen
161161
coordinates.

lib/matplotlib/patches.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -994,9 +994,10 @@ def __init__(self, values, edges, *,
994994
True or an array is passed to *baseline*, a closed
995995
path is drawn.
996996
997-
Other valid keyword arguments are:
997+
**kwargs
998+
`Patch` properties:
998999
999-
%(Patch:kwdoc)s
1000+
%(Patch:kwdoc)s
10001001
"""
10011002
self.orientation = orientation
10021003
self._edges = np.asarray(edges)
@@ -1112,7 +1113,7 @@ def set_closed(self, closed):
11121113
Parameters
11131114
----------
11141115
closed : bool
1115-
True if the polygon is closed
1116+
True if the polygon is closed
11161117
"""
11171118
if self._closed == bool(closed):
11181119
return

lib/mpl_toolkits/axes_grid1/axes_divider.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ def __init__(self, fig, pos, horizontal, vertical,
3737
Sizes for horizontal division.
3838
vertical : list of :mod:`~mpl_toolkits.axes_grid1.axes_size`
3939
Sizes for vertical division.
40-
aspect : bool
40+
aspect : bool, optional
4141
Whether overall rectangular area is reduced so that the relative
4242
part of the horizontal and vertical scales have the same scale.
4343
anchor : (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', 'N', \
44-
'NW', 'W'}
44+
'NW', 'W'}, default: 'C'
4545
Placement of the reduced rectangle, when *aspect* is True.
4646
"""
4747

@@ -294,7 +294,7 @@ def add_auto_adjustable_area(self, use_axes, pad=0.1, adjust_dirs=None):
294294
----------
295295
use_axes : `~matplotlib.axes.Axes` or list of `~matplotlib.axes.Axes`
296296
The Axes whose decorations are taken into account.
297-
pad : float, optional
297+
pad : float, default: 0.1
298298
Additional padding in inches.
299299
adjust_dirs : list of {"left", "right", "bottom", "top"}, optional
300300
The sides where padding is added; defaults to all four sides.
@@ -377,6 +377,16 @@ def __init__(self, fig, *args, horizontal=None, vertical=None,
377377
If *nrows*, *ncols*, and *index* are all single digit numbers, then
378378
*args* can be passed as a single 3-digit number (e.g. 234 for
379379
(2, 3, 4)).
380+
horizontal : list of :mod:`~mpl_toolkits.axes_grid1.axes_size`, optional
381+
Sizes for horizontal division.
382+
vertical : list of :mod:`~mpl_toolkits.axes_grid1.axes_size`, optional
383+
Sizes for vertical division.
384+
aspect : bool, optional
385+
Whether overall rectangular area is reduced so that the relative
386+
part of the horizontal and vertical scales have the same scale.
387+
anchor : (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', 'N', \
388+
'NW', 'W'}, default: 'C'
389+
Placement of the reduced rectangle, when *aspect* is True.
380390
"""
381391
self.figure = fig
382392
super().__init__(fig, [0, 0, 1, 1],

lib/mpl_toolkits/axes_grid1/axes_rgb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def make_rgb_axes(ax, pad=0.01, axes_class=None, **kwargs):
1717
axes_class : `matplotlib.axes.Axes` or None, optional
1818
Axes class to use for the R, G, and B Axes. If None, use
1919
the same class as *ax*.
20-
**kwargs :
20+
**kwargs
2121
Forwarded to *axes_class* init for the R, G, and B Axes.
2222
"""
2323

@@ -130,7 +130,7 @@ def imshow_rgb(self, r, g, b, **kwargs):
130130
----------
131131
r, g, b : array-like
132132
The red, green, and blue arrays.
133-
**kwargs :
133+
**kwargs
134134
Forwarded to `~.Axes.imshow` calls for the four images.
135135
136136
Returns

lib/mpl_toolkits/axes_grid1/parasite_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def get_aux_axes(
105105
axes_class : subclass type of `~matplotlib.axes.Axes`, optional
106106
The `~.axes.Axes` subclass that is instantiated. If None, the base
107107
class of the host axes is used.
108-
kwargs
108+
**kwargs
109109
Other parameters are forwarded to the parasite axes constructor.
110110
"""
111111
if axes_class is None:

lib/mpl_toolkits/axisartist/axis_artist.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -602,11 +602,11 @@ def __init__(self, *args, which="major", axis="both", **kwargs):
602602
Parameters
603603
----------
604604
which : {"major", "minor"}
605-
Which grid to consider.
605+
Which grid to consider.
606606
axis : {"both", "x", "y"}
607-
Which axis to consider.
608-
*args, **kwargs :
609-
Passed to `.LineCollection`.
607+
Which axis to consider.
608+
*args, **kwargs
609+
Passed to `.LineCollection`.
610610
"""
611611
self._which = which
612612
self._axis = axis

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def __init__(self, xs, ys, zs, *args, **kwargs):
202202
The y-data to be plotted.
203203
zs : array-like
204204
The z-data to be plotted.
205-
*args, **kwargs :
205+
*args, **kwargs
206206
Additional arguments are passed to `~matplotlib.lines.Line2D`.
207207
"""
208208
super().__init__([], [], *args, **kwargs)

lib/mpl_toolkits/mplot3d/axis3d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def set_ticks_position(self, position):
192192
193193
Parameters
194194
----------
195-
str : {'lower', 'upper', 'both', 'default', 'none'}
195+
position : {'lower', 'upper', 'both', 'default', 'none'}
196196
The position of the bolded axis lines, ticks, and tick labels.
197197
"""
198198
if position in ['top', 'bottom']:
@@ -221,7 +221,7 @@ def set_label_position(self, position):
221221
222222
Parameters
223223
----------
224-
str : {'lower', 'upper', 'both', 'default', 'none'}
224+
position : {'lower', 'upper', 'both', 'default', 'none'}
225225
The position of the axis label.
226226
"""
227227
if position in ['top', 'bottom']:

0 commit comments

Comments
 (0)