Skip to content

Commit e51fc7b

Browse files
committed
Use :mpltype:color for color types
1 parent e5a85f9 commit e51fc7b

21 files changed

+80
-80
lines changed

lib/matplotlib/axes/_axes.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,10 @@ def indicate_inset(self, bounds, inset_ax=None, *, transform=None,
430430
`ax.transAxes`, i.e. the units of *rect* are in Axes-relative
431431
coordinates.
432432
433-
facecolor : color, default: 'none'
433+
facecolor : :mpltype:`color`, default: 'none'
434434
Facecolor of the rectangle.
435435
436-
edgecolor : color, default: '0.5'
436+
edgecolor : :mpltype:`color`, default: '0.5'
437437
Color of the rectangle and color of the connecting lines.
438438
439439
alpha : float, default: 0.5
@@ -1076,7 +1076,7 @@ def hlines(self, y, xmin, xmax, colors=None, linestyles='solid',
10761076
Respective beginning and end of each line. If scalars are
10771077
provided, all lines will have the same length.
10781078
1079-
colors : color or list of colors, default: :rc:`lines.color`
1079+
colors : :mpltype:`color` or list of colors, default: :rc:`lines.color`
10801080
10811081
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, default: 'solid'
10821082
@@ -1167,7 +1167,7 @@ def vlines(self, x, ymin, ymax, colors=None, linestyles='solid',
11671167
Respective beginning and end of each line. If scalars are
11681168
provided, all lines will have the same length.
11691169
1170-
colors : color or list of colors, default: :rc:`lines.color`
1170+
colors : :mpltype:`color` or list of colors, default: :rc:`lines.color`
11711171
11721172
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, default: 'solid'
11731173
@@ -1303,7 +1303,7 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
13031303
If *positions* is 2D, this can be a sequence with length matching
13041304
the length of *positions*.
13051305
1306-
colors : color or list of colors, default: :rc:`lines.color`
1306+
colors : :mpltype:`color` or list of colors, default: :rc:`lines.color`
13071307
The color(s) of the event lines.
13081308
13091309
If *positions* is 2D, this can be a sequence with length matching
@@ -2336,10 +2336,10 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
23362336
23372337
Other Parameters
23382338
----------------
2339-
color : color or list of color, optional
2339+
color : :mpltype:`color` or list of color, optional
23402340
The colors of the bar faces.
23412341
2342-
edgecolor : color or list of color, optional
2342+
edgecolor : :mpltype:`color` or list of color, optional
23432343
The colors of the bar edges.
23442344
23452345
linewidth : float or array-like, optional
@@ -2371,7 +2371,7 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
23712371
See :doc:`/gallery/statistics/errorbar_features` for an example on
23722372
the usage of *xerr* and *yerr*.
23732373
2374-
ecolor : color or list of color, default: 'black'
2374+
ecolor : :mpltype:`color` or list of color, default: 'black'
23752375
The line color of the errorbars.
23762376
23772377
capsize : float, default: :rc:`errorbar.capsize`
@@ -2649,10 +2649,10 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
26492649
26502650
Other Parameters
26512651
----------------
2652-
color : color or list of color, optional
2652+
color : :mpltype:`color` or list of color, optional
26532653
The colors of the bar faces.
26542654
2655-
edgecolor : color or list of color, optional
2655+
edgecolor : :mpltype:`color` or list of color, optional
26562656
The colors of the bar edges.
26572657
26582658
linewidth : float or array-like, optional
@@ -2684,7 +2684,7 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
26842684
See :doc:`/gallery/statistics/errorbar_features` for an example on
26852685
the usage of *xerr* and *yerr*.
26862686
2687-
ecolor : color or list of color, default: 'black'
2687+
ecolor : :mpltype:`color` or list of color, default: 'black'
26882688
The line color of the errorbars.
26892689
26902690
capsize : float, default: :rc:`errorbar.capsize`
@@ -3142,7 +3142,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
31423142
labels : list, default: None
31433143
A sequence of strings providing the labels for each wedge
31443144
3145-
colors : color or array-like of color, default: None
3145+
colors : :mpltype:`color` or array-like of color, default: None
31463146
A sequence of colors through which the pie chart will cycle. If
31473147
*None*, will use the colors in the currently active cycle.
31483148
@@ -3437,7 +3437,7 @@ def errorbar(self, x, y, yerr=None, xerr=None,
34373437
Use 'none' (case-insensitive) to plot errorbars without any data
34383438
markers.
34393439
3440-
ecolor : color, default: None
3440+
ecolor : :mpltype:`color`, default: None
34413441
The color of the errorbar lines. If None, use the color of the
34423442
line connecting the markers.
34433443
@@ -4400,9 +4400,9 @@ def _parse_scatter_color_args(c, edgecolors, kwargs, xsize,
44004400
44014401
Parameters
44024402
----------
4403-
c : color or sequence or sequence of color or None
4403+
c : :mpltype:`color` or sequence or sequence of color or None
44044404
See argument description of `.Axes.scatter`.
4405-
edgecolors : color or sequence of color or {'face', 'none'} or None
4405+
edgecolors : :mpltype:`color` or sequence of color or {'face', 'none'} or None
44064406
See argument description of `.Axes.scatter`.
44074407
kwargs : dict
44084408
Additional kwargs. If these keys exist, we pop and process them:
@@ -6718,7 +6718,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
67186718
log : bool, default: False
67196719
If ``True``, the histogram axis will be set to a log scale.
67206720
6721-
color : color or array-like of colors or None, default: None
6721+
color : :mpltype:`color` or array-like of colors or None, default: None
67226722
Color or sequence of colors, one per dataset. Default (``None``)
67236723
uses the standard line color sequence.
67246724

lib/matplotlib/axes/_base.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ def set_facecolor(self, color):
14991499
15001500
Parameters
15011501
----------
1502-
color : color; see :ref:`colors_def`
1502+
color : :mpltype:`color`
15031503
"""
15041504
self._facecolor = color
15051505
self.stale = True
@@ -3371,17 +3371,17 @@ def tick_params(self, axis='both', **kwargs):
33713371
Tick length in points.
33723372
width : float
33733373
Tick width in points.
3374-
color : color
3374+
color : :mpltype:`color`
33753375
Tick color.
33763376
pad : float
33773377
Distance in points between tick and label.
33783378
labelsize : float or str
33793379
Tick label font size in points or as a string (e.g., 'large').
3380-
labelcolor : color
3380+
labelcolor : :mpltype:`color`
33813381
Tick label color.
33823382
labelfontfamily : str
33833383
Tick label font.
3384-
colors : color
3384+
colors : :mpltype:`color`
33853385
Tick color and label color.
33863386
zorder : float
33873387
Tick and label zorder.
@@ -3391,7 +3391,7 @@ def tick_params(self, axis='both', **kwargs):
33913391
Whether to draw the respective tick labels.
33923392
labelrotation : float
33933393
Tick label rotation
3394-
grid_color : color
3394+
grid_color : :mpltype:`color`
33953395
Gridline color.
33963396
grid_alpha : float
33973397
Transparency of gridlines: 0 (transparent) to 1 (opaque).

lib/matplotlib/axes/_secondary_axes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def set_color(self, color):
240240
241241
Parameters
242242
----------
243-
color : color; see :ref:`colors_def`
243+
color : :mpltype:`color`
244244
"""
245245
axis = self._axis_map[self._orientation]
246246
axis.set_tick_params(colors=color)

lib/matplotlib/backend_bases.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def draw_markers(self, gc, marker_path, marker_trans, path,
218218
The locations to draw the markers.
219219
trans : `~matplotlib.transforms.Transform`
220220
An affine transform applied to the path.
221-
rgbFace : color, optional
221+
rgbFace : :mpltype:`color`, optional
222222
"""
223223
for vertices, codes in path.iter_segments(trans, simplify=False):
224224
if len(vertices):
@@ -956,7 +956,7 @@ def set_foreground(self, fg, isRGBA=False):
956956
957957
Parameters
958958
----------
959-
fg : color
959+
fg : :mpltype:`color`
960960
isRGBA : bool
961961
If *fg* is known to be an ``(r, g, b, a)`` tuple, *isRGBA* can be
962962
set to True to improve performance.
@@ -2111,11 +2111,11 @@ def print_figure(
21112111
dpi : float, default: :rc:`savefig.dpi`
21122112
The dots per inch to save the figure in.
21132113
2114-
facecolor : color or 'auto', default: :rc:`savefig.facecolor`
2114+
facecolor : :mpltype:`color` or 'auto', default: :rc:`savefig.facecolor`
21152115
The facecolor of the figure. If 'auto', use the current figure
21162116
facecolor.
21172117
2118-
edgecolor : color or 'auto', default: :rc:`savefig.edgecolor`
2118+
edgecolor : :mpltype:`color` or 'auto', default: :rc:`savefig.edgecolor`
21192119
The edgecolor of the figure. If 'auto', use the current figure
21202120
edgecolor.
21212121

lib/matplotlib/collections.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ def __init__(self, *,
9696
"""
9797
Parameters
9898
----------
99-
edgecolors : color or list of colors, default: :rc:`patch.edgecolor`
99+
edgecolors : :mpltype:`color` or list of colors, default: :rc:`patch.edgecolor`
100100
Edge color for each patch making up the collection. The special
101101
value 'face' can be passed to make the edgecolor match the
102102
facecolor.
103-
facecolors : color or list of colors, default: :rc:`patch.facecolor`
103+
facecolors : :mpltype:`color` or list of colors, default: :rc:`patch.facecolor`
104104
Face color for each patch making up the collection.
105105
linewidths : float or list of floats, default: :rc:`patch.linewidth`
106106
Line width for each patch making up the collection.
@@ -745,7 +745,7 @@ def set_color(self, c):
745745
746746
Parameters
747747
----------
748-
c : color or list of RGBA tuples
748+
c : :mpltype:`color` or list of RGBA tuples
749749
750750
See Also
751751
--------
@@ -776,7 +776,7 @@ def set_facecolor(self, c):
776776
777777
Parameters
778778
----------
779-
c : color or list of colors
779+
c : :mpltype:`color` or list of colors
780780
"""
781781
if isinstance(c, str) and c.lower() in ("none", "face"):
782782
c = c.lower()
@@ -821,7 +821,7 @@ def set_edgecolor(self, c):
821821
822822
Parameters
823823
----------
824-
c : color or list of colors or 'face'
824+
c : :mpltype:`color` or list of colors or 'face'
825825
The collection edgecolor(s). If a sequence, the patches cycle
826826
through it. If 'face', match the facecolor.
827827
"""
@@ -1368,15 +1368,15 @@ def __init__(self, segments, # Can be None.
13681368
can have a different number of segments.
13691369
linewidths : float or list of float, default: :rc:`lines.linewidth`
13701370
The width of each line in points.
1371-
colors : color or list of color, default: :rc:`lines.color`
1371+
colors : :mpltype:`color` or list of color, default: :rc:`lines.color`
13721372
A sequence of RGBA tuples (e.g., arbitrary color strings, etc, not
13731373
allowed).
13741374
antialiaseds : bool or list of bool, default: :rc:`lines.antialiased`
13751375
Whether to use antialiasing for each line.
13761376
zorder : float, default: 2
13771377
zorder of the lines once drawn.
13781378
1379-
facecolors : color or list of color, default: 'none'
1379+
facecolors : :mpltype:`color` or list of color, default: 'none'
13801380
When setting *facecolors*, each line is interpreted as a boundary
13811381
for an area, implicitly closing the path from the last point to the
13821382
first point. The enclosed area is filled with *facecolor*.
@@ -1455,7 +1455,7 @@ def set_color(self, c):
14551455
14561456
Parameters
14571457
----------
1458-
c : color or list of colors
1458+
c : :mpltype:`color` or list of colors
14591459
Single color (all lines have same color), or a
14601460
sequence of RGBA tuples; if it is a sequence the lines will
14611461
cycle through the sequence.
@@ -1483,7 +1483,7 @@ def set_gapcolor(self, gapcolor):
14831483
14841484
Parameters
14851485
----------
1486-
gapcolor : color or list of colors or None
1486+
gapcolor : :mpltype:`color` or list of colors or None
14871487
The color with which to fill the gaps. If None, the gaps are
14881488
unfilled.
14891489
"""
@@ -1556,7 +1556,7 @@ def __init__(self,
15561556
``lineoffset - linelength/2`` to ``lineoffset + linelength/2``).
15571557
linewidth : float or list thereof, default: :rc:`lines.linewidth`
15581558
The line width of the event lines, in points.
1559-
color : color or list of colors, default: :rc:`lines.color`
1559+
color : :mpltype:`color` or list of colors, default: :rc:`lines.color`
15601560
The color of the event lines.
15611561
linestyle : str or tuple or list thereof, default: 'solid'
15621562
Valid strings are ['solid', 'dashed', 'dashdot', 'dotted',

lib/matplotlib/colorbar.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ def add_lines(self, *args, **kwargs):
730730
----------
731731
levels : array-like
732732
The positions of the lines.
733-
colors : color or list of colors
733+
colors : :mpltype:`color` or list of colors
734734
Either a single color applying to all lines or one color value for
735735
each line.
736736
linewidths : float or array-like

lib/matplotlib/contour.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def clabel(self, levels=None, *,
7878
Size in points or relative size e.g., 'smaller', 'x-large'.
7979
See `.Text.set_size` for accepted string values.
8080
81-
colors : color or colors or None, default: None
81+
colors : :mpltype:`color` or colors or None, default: None
8282
The label colors:
8383
8484
- If *None*, the color of each label matches the color of

lib/matplotlib/figure.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def set_edgecolor(self, color):
410410
411411
Parameters
412412
----------
413-
color : color; see :ref:`colors_def`
413+
color : :mpltype:`color`
414414
"""
415415
self.patch.set_edgecolor(color)
416416

@@ -420,7 +420,7 @@ def set_facecolor(self, color):
420420
421421
Parameters
422422
----------
423-
color : color; see :ref:`colors_def`
423+
color : :mpltype:`color`
424424
"""
425425
self.patch.set_facecolor(color)
426426

@@ -3279,11 +3279,11 @@ def savefig(self, fname, *, transparent=None, **kwargs):
32793279
compressed layout engine; ignored if one of those engines is not in
32803280
use.
32813281
3282-
facecolor : color or 'auto', default: :rc:`savefig.facecolor`
3282+
facecolor : :mpltype:`color` or 'auto', default: :rc:`savefig.facecolor`
32833283
The facecolor of the figure. If 'auto', use the current figure
32843284
facecolor.
32853285
3286-
edgecolor : color or 'auto', default: :rc:`savefig.edgecolor`
3286+
edgecolor : :mpltype:`color` or 'auto', default: :rc:`savefig.edgecolor`
32873287
The edgecolor of the figure. If 'auto', use the current figure
32883288
edgecolor.
32893289

lib/matplotlib/lines.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ def set_color(self, color):
10561056
10571057
Parameters
10581058
----------
1059-
color : color; see :ref:`colors_def`
1059+
color : :mpltype:`color`
10601060
"""
10611061
mcolors._check_color_like(color=color)
10621062
self._color = color
@@ -1111,7 +1111,7 @@ def set_gapcolor(self, gapcolor):
11111111
11121112
Parameters
11131113
----------
1114-
gapcolor : color or None
1114+
gapcolor : :mpltype:`color` or None
11151115
The color with which to fill the gaps. If None, the gaps are
11161116
unfilled.
11171117
"""
@@ -1214,7 +1214,7 @@ def set_markeredgecolor(self, ec):
12141214
12151215
Parameters
12161216
----------
1217-
ec : color
1217+
ec : :mpltype:`color`
12181218
"""
12191219
self._set_markercolor("markeredgecolor", True, ec)
12201220

@@ -1224,7 +1224,7 @@ def set_markerfacecolor(self, fc):
12241224
12251225
Parameters
12261226
----------
1227-
fc : color
1227+
fc : :mpltype:`color`
12281228
"""
12291229
self._set_markercolor("markerfacecolor", True, fc)
12301230

@@ -1234,7 +1234,7 @@ def set_markerfacecoloralt(self, fc):
12341234
12351235
Parameters
12361236
----------
1237-
fc : color
1237+
fc : :mpltype:`color`
12381238
"""
12391239
self._set_markercolor("markerfacecoloralt", False, fc)
12401240

0 commit comments

Comments
 (0)