Skip to content

Commit

Permalink
Use :mpltype:color for color types
Browse files Browse the repository at this point in the history
  • Loading branch information
timhoffm committed Dec 22, 2023
1 parent 8f296db commit 979d61c
Show file tree
Hide file tree
Showing 21 changed files with 80 additions and 80 deletions.
32 changes: 16 additions & 16 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,10 @@ def indicate_inset(self, bounds, inset_ax=None, *, transform=None,
`ax.transAxes`, i.e. the units of *rect* are in Axes-relative
coordinates.
facecolor : color, default: 'none'
facecolor : :mpltype:`color`, default: 'none'
Facecolor of the rectangle.
edgecolor : color, default: '0.5'
edgecolor : :mpltype:`color`, default: '0.5'
Color of the rectangle and color of the connecting lines.
alpha : float, default: 0.5
Expand Down Expand Up @@ -1076,7 +1076,7 @@ def hlines(self, y, xmin, xmax, colors=None, linestyles='solid',
Respective beginning and end of each line. If scalars are
provided, all lines will have the same length.
colors : color or list of colors, default: :rc:`lines.color`
colors : :mpltype:`color` or list of colors, default: :rc:`lines.color`
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, default: 'solid'
Expand Down Expand Up @@ -1167,7 +1167,7 @@ def vlines(self, x, ymin, ymax, colors=None, linestyles='solid',
Respective beginning and end of each line. If scalars are
provided, all lines will have the same length.
colors : color or list of colors, default: :rc:`lines.color`
colors : :mpltype:`color` or list of colors, default: :rc:`lines.color`
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, default: 'solid'
Expand Down Expand Up @@ -1303,7 +1303,7 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
If *positions* is 2D, this can be a sequence with length matching
the length of *positions*.
colors : color or list of colors, default: :rc:`lines.color`
colors : :mpltype:`color` or list of colors, default: :rc:`lines.color`
The color(s) of the event lines.
If *positions* is 2D, this can be a sequence with length matching
Expand Down Expand Up @@ -2336,10 +2336,10 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
Other Parameters
----------------
color : color or list of color, optional
color : :mpltype:`color` or list of color, optional
The colors of the bar faces.
edgecolor : color or list of color, optional
edgecolor : :mpltype:`color` or list of color, optional
The colors of the bar edges.
linewidth : float or array-like, optional
Expand Down Expand Up @@ -2371,7 +2371,7 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
See :doc:`/gallery/statistics/errorbar_features` for an example on
the usage of *xerr* and *yerr*.
ecolor : color or list of color, default: 'black'
ecolor : :mpltype:`color` or list of color, default: 'black'
The line color of the errorbars.
capsize : float, default: :rc:`errorbar.capsize`
Expand Down Expand Up @@ -2649,10 +2649,10 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
Other Parameters
----------------
color : color or list of color, optional
color : :mpltype:`color` or list of color, optional
The colors of the bar faces.
edgecolor : color or list of color, optional
edgecolor : :mpltype:`color` or list of color, optional
The colors of the bar edges.
linewidth : float or array-like, optional
Expand Down Expand Up @@ -2684,7 +2684,7 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
See :doc:`/gallery/statistics/errorbar_features` for an example on
the usage of *xerr* and *yerr*.
ecolor : color or list of color, default: 'black'
ecolor : :mpltype:`color` or list of color, default: 'black'
The line color of the errorbars.
capsize : float, default: :rc:`errorbar.capsize`
Expand Down Expand Up @@ -3142,7 +3142,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
labels : list, default: None
A sequence of strings providing the labels for each wedge
colors : color or array-like of color, default: None
colors : :mpltype:`color` or array-like of color, default: None
A sequence of colors through which the pie chart will cycle. If
*None*, will use the colors in the currently active cycle.
Expand Down Expand Up @@ -3437,7 +3437,7 @@ def errorbar(self, x, y, yerr=None, xerr=None,
Use 'none' (case-insensitive) to plot errorbars without any data
markers.
ecolor : color, default: None
ecolor : :mpltype:`color`, default: None
The color of the errorbar lines. If None, use the color of the
line connecting the markers.
Expand Down Expand Up @@ -4400,9 +4400,9 @@ def _parse_scatter_color_args(c, edgecolors, kwargs, xsize,
Parameters
----------
c : color or sequence or sequence of color or None
c : :mpltype:`color` or sequence or sequence of color or None
See argument description of `.Axes.scatter`.
edgecolors : color or sequence of color or {'face', 'none'} or None
edgecolors : :mpltype:`color` or sequence of color or {'face', 'none'} or None
See argument description of `.Axes.scatter`.
kwargs : dict
Additional kwargs. If these keys exist, we pop and process them:
Expand Down Expand Up @@ -6718,7 +6718,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
log : bool, default: False
If ``True``, the histogram axis will be set to a log scale.
color : color or array-like of colors or None, default: None
color : :mpltype:`color` or array-like of colors or None, default: None
Color or sequence of colors, one per dataset. Default (``None``)
uses the standard line color sequence.
Expand Down
10 changes: 5 additions & 5 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ def set_facecolor(self, color):
Parameters
----------
color : color; see :ref:`colors_def`
color : :mpltype:`color`
"""
self._facecolor = color
self.stale = True
Expand Down Expand Up @@ -3371,17 +3371,17 @@ def tick_params(self, axis='both', **kwargs):
Tick length in points.
width : float
Tick width in points.
color : color
color : :mpltype:`color`
Tick color.
pad : float
Distance in points between tick and label.
labelsize : float or str
Tick label font size in points or as a string (e.g., 'large').
labelcolor : color
labelcolor : :mpltype:`color`
Tick label color.
labelfontfamily : str
Tick label font.
colors : color
colors : :mpltype:`color`
Tick color and label color.
zorder : float
Tick and label zorder.
Expand All @@ -3391,7 +3391,7 @@ def tick_params(self, axis='both', **kwargs):
Whether to draw the respective tick labels.
labelrotation : float
Tick label rotation
grid_color : color
grid_color : :mpltype:`color`
Gridline color.
grid_alpha : float
Transparency of gridlines: 0 (transparent) to 1 (opaque).
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/axes/_secondary_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def set_color(self, color):
Parameters
----------
color : color; see :ref:`colors_def`
color : :mpltype:`color`
"""
axis = self._axis_map[self._orientation]
axis.set_tick_params(colors=color)
Expand Down
8 changes: 4 additions & 4 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def draw_markers(self, gc, marker_path, marker_trans, path,
The locations to draw the markers.
trans : `~matplotlib.transforms.Transform`
An affine transform applied to the path.
rgbFace : color, optional
rgbFace : :mpltype:`color`, optional
"""
for vertices, codes in path.iter_segments(trans, simplify=False):
if len(vertices):
Expand Down Expand Up @@ -956,7 +956,7 @@ def set_foreground(self, fg, isRGBA=False):
Parameters
----------
fg : color
fg : :mpltype:`color`
isRGBA : bool
If *fg* is known to be an ``(r, g, b, a)`` tuple, *isRGBA* can be
set to True to improve performance.
Expand Down Expand Up @@ -2111,11 +2111,11 @@ def print_figure(
dpi : float, default: :rc:`savefig.dpi`
The dots per inch to save the figure in.
facecolor : color or 'auto', default: :rc:`savefig.facecolor`
facecolor : :mpltype:`color` or 'auto', default: :rc:`savefig.facecolor`
The facecolor of the figure. If 'auto', use the current figure
facecolor.
edgecolor : color or 'auto', default: :rc:`savefig.edgecolor`
edgecolor : :mpltype:`color` or 'auto', default: :rc:`savefig.edgecolor`
The edgecolor of the figure. If 'auto', use the current figure
edgecolor.
Expand Down
20 changes: 10 additions & 10 deletions lib/matplotlib/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ def __init__(self, *,
"""
Parameters
----------
edgecolors : color or list of colors, default: :rc:`patch.edgecolor`
edgecolors : :mpltype:`color` or list of colors, default: :rc:`patch.edgecolor`
Edge color for each patch making up the collection. The special
value 'face' can be passed to make the edgecolor match the
facecolor.
facecolors : color or list of colors, default: :rc:`patch.facecolor`
facecolors : :mpltype:`color` or list of colors, default: :rc:`patch.facecolor`
Face color for each patch making up the collection.
linewidths : float or list of floats, default: :rc:`patch.linewidth`
Line width for each patch making up the collection.
Expand Down Expand Up @@ -745,7 +745,7 @@ def set_color(self, c):
Parameters
----------
c : color or list of RGBA tuples
c : :mpltype:`color` or list of RGBA tuples
See Also
--------
Expand Down Expand Up @@ -776,7 +776,7 @@ def set_facecolor(self, c):
Parameters
----------
c : color or list of colors
c : :mpltype:`color` or list of colors
"""
if isinstance(c, str) and c.lower() in ("none", "face"):
c = c.lower()
Expand Down Expand Up @@ -821,7 +821,7 @@ def set_edgecolor(self, c):
Parameters
----------
c : color or list of colors or 'face'
c : :mpltype:`color` or list of colors or 'face'
The collection edgecolor(s). If a sequence, the patches cycle
through it. If 'face', match the facecolor.
"""
Expand Down Expand Up @@ -1368,15 +1368,15 @@ def __init__(self, segments, # Can be None.
can have a different number of segments.
linewidths : float or list of float, default: :rc:`lines.linewidth`
The width of each line in points.
colors : color or list of color, default: :rc:`lines.color`
colors : :mpltype:`color` or list of color, default: :rc:`lines.color`
A sequence of RGBA tuples (e.g., arbitrary color strings, etc, not
allowed).
antialiaseds : bool or list of bool, default: :rc:`lines.antialiased`
Whether to use antialiasing for each line.
zorder : float, default: 2
zorder of the lines once drawn.
facecolors : color or list of color, default: 'none'
facecolors : :mpltype:`color` or list of color, default: 'none'
When setting *facecolors*, each line is interpreted as a boundary
for an area, implicitly closing the path from the last point to the
first point. The enclosed area is filled with *facecolor*.
Expand Down Expand Up @@ -1455,7 +1455,7 @@ def set_color(self, c):
Parameters
----------
c : color or list of colors
c : :mpltype:`color` or list of colors
Single color (all lines have same color), or a
sequence of RGBA tuples; if it is a sequence the lines will
cycle through the sequence.
Expand Down Expand Up @@ -1483,7 +1483,7 @@ def set_gapcolor(self, gapcolor):
Parameters
----------
gapcolor : color or list of colors or None
gapcolor : :mpltype:`color` or list of colors or None
The color with which to fill the gaps. If None, the gaps are
unfilled.
"""
Expand Down Expand Up @@ -1556,7 +1556,7 @@ def __init__(self,
``lineoffset - linelength/2`` to ``lineoffset + linelength/2``).
linewidth : float or list thereof, default: :rc:`lines.linewidth`
The line width of the event lines, in points.
color : color or list of colors, default: :rc:`lines.color`
color : :mpltype:`color` or list of colors, default: :rc:`lines.color`
The color of the event lines.
linestyle : str or tuple or list thereof, default: 'solid'
Valid strings are ['solid', 'dashed', 'dashdot', 'dotted',
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def add_lines(self, *args, **kwargs):
----------
levels : array-like
The positions of the lines.
colors : color or list of colors
colors : :mpltype:`color` or list of colors
Either a single color applying to all lines or one color value for
each line.
linewidths : float or array-like
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def clabel(self, levels=None, *,
Size in points or relative size e.g., 'smaller', 'x-large'.
See `.Text.set_size` for accepted string values.
colors : color or colors or None, default: None
colors : :mpltype:`color` or colors or None, default: None
The label colors:
- If *None*, the color of each label matches the color of
Expand Down
8 changes: 4 additions & 4 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def set_edgecolor(self, color):
Parameters
----------
color : color; see :ref:`colors_def`
color : :mpltype:`color`
"""
self.patch.set_edgecolor(color)

Expand All @@ -420,7 +420,7 @@ def set_facecolor(self, color):
Parameters
----------
color : color; see :ref:`colors_def`
color : :mpltype:`color`
"""
self.patch.set_facecolor(color)

Expand Down Expand Up @@ -3279,11 +3279,11 @@ def savefig(self, fname, *, transparent=None, **kwargs):
compressed layout engine; ignored if one of those engines is not in
use.
facecolor : color or 'auto', default: :rc:`savefig.facecolor`
facecolor : :mpltype:`color` or 'auto', default: :rc:`savefig.facecolor`
The facecolor of the figure. If 'auto', use the current figure
facecolor.
edgecolor : color or 'auto', default: :rc:`savefig.edgecolor`
edgecolor : :mpltype:`color` or 'auto', default: :rc:`savefig.edgecolor`
The edgecolor of the figure. If 'auto', use the current figure
edgecolor.
Expand Down
10 changes: 5 additions & 5 deletions lib/matplotlib/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ def set_color(self, color):
Parameters
----------
color : color; see :ref:`colors_def`
color : :mpltype:`color`
"""
mcolors._check_color_like(color=color)
self._color = color
Expand Down Expand Up @@ -1111,7 +1111,7 @@ def set_gapcolor(self, gapcolor):
Parameters
----------
gapcolor : color or None
gapcolor : :mpltype:`color` or None
The color with which to fill the gaps. If None, the gaps are
unfilled.
"""
Expand Down Expand Up @@ -1214,7 +1214,7 @@ def set_markeredgecolor(self, ec):
Parameters
----------
ec : color
ec : :mpltype:`color`
"""
self._set_markercolor("markeredgecolor", True, ec)

Expand All @@ -1224,7 +1224,7 @@ def set_markerfacecolor(self, fc):
Parameters
----------
fc : color
fc : :mpltype:`color`
"""
self._set_markercolor("markerfacecolor", True, fc)

Expand All @@ -1234,7 +1234,7 @@ def set_markerfacecoloralt(self, fc):
Parameters
----------
fc : color
fc : :mpltype:`color`
"""
self._set_markercolor("markerfacecoloralt", False, fc)

Expand Down
Loading

0 comments on commit 979d61c

Please sign in to comment.