8000 Improve color documentation and typing · matplotlib/matplotlib@8a78154 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8a78154

Browse files
committed
Improve color documentation and typing
1 parent 8dd2b04 commit 8a78154

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,9 +1047,9 @@ def hlines(self, y, xmin, xmax, colors=None, linestyles='solid',
10471047
Respective beginning and end of each line. If scalars are
10481048
provided, all lines will have the same length.
10491049
1050-
colors : list of colors, default: :rc:`lines.color`
1050+
colors : color or list of colors, default: :rc:`lines.color`
10511051
1052-
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, optional
1052+
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, default: 'solid'
10531053
10541054
label : str, default: ''
10551055
@@ -1127,9 +1127,9 @@ def vlines(self, x, ymin, ymax, colors=None, linestyles='solid',
11271127
Respective beginning and end of each line. If scalars are
11281128
provided, all lines will have the same length.
11291129
1130-
colors : list of colors, default: :rc:`lines.color`
1130+
colors : color or list of colors, default: :rc:`lines.color`
11311131
1132-
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, optional
1132+
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, default: 'solid'
11331133
11341134
label : str, default: ''
11351135
@@ -3072,7 +3072,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
30723072
labels : list, default: None
30733073
A sequence of strings providing the labels for each wedge
30743074
3075-
colors : array-like, default: None
3075+
colors : color or array-like of color, default: None
30763076
A sequence of colors through which the pie chart will cycle. If
30773077
*None*, will use the colors in the currently active cycle.
30783078

lib/matplotlib/axes/_axes.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class Axes(_AxesBase):
163163
y: float | ArrayLike,
164164
xmin: float | ArrayLike,
165165
xmax: float | ArrayLike,
166-
colors: Sequence[ColorType] | None = ...,
166+
colors: ColorType | Sequence[ColorType] | None = ...,
167167
linestyles: LineStyleType = ...,
168168
label: str = ...,
169169
**kwargs
@@ -173,7 +173,7 @@ class Axes(_AxesBase):
173173
x: float | ArrayLike,
174174
ymin: float | ArrayLike,
175175
ymax: float | ArrayLike,
176-
colors: Sequence[ColorType] | None = ...,
176+
colors: ColorType | Sequence[ColorType] | None = ...,
177177
linestyles: LineStyleType = ...,
178178
label: str = ...,
179179
**kwargs
@@ -287,7 +287,7 @@ class Axes(_AxesBase):
287287
x: ArrayLike,
288288
explode: ArrayLike | None = ...,
289289
labels: Sequence[str] | None = ...,
290-
colors: Sequence[ColorType] | None = ...,
290+
colors: ColorType | Sequence[ColorType] | None = ...,
291291
autopct: str | Callable[[float], str] | None = ...,
292292
pctdistance: float = ...,
293293
shadow: bool = ...,

lib/matplotlib/pyplot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3207,7 +3207,7 @@ def hlines(
32073207
y: float | ArrayLike,
32083208
xmin: float | ArrayLike,
32093209
xmax: float | ArrayLike,
3210-
colors: Sequence[ColorType] | None = None,
3210+
colors: ColorType | Sequence[ColorType] | None = None,
32113211
linestyles: LineStyleType = "solid",
32123212
label: str = "",
32133213
*,
@@ -3430,7 +3430,7 @@ def pie(
34303430
x: ArrayLike,
34313431
explode: ArrayLike | None = None,
34323432
labels: Sequence[str] | None = None,
3433-
colors: Sequence[ColorType] | None = None,
3433+
colors: ColorType | Sequence[ColorType] | None = None,
34343434
autopct: str | Callable[[float], str] | None = None,
34353435
pctdistance: float = 0.6,
34363436
shadow: bool = False,
@@ -3966,7 +3966,7 @@ def vlines(
39663966
x: float | ArrayLike,
39673967
ymin: float | ArrayLike,
39683968
ymax: float | ArrayLike,
3969-
colors: Sequence[ColorType] | None = None,
3969+
colors: ColorType | Sequence[ColorType] | None = None,
39703970
linestyles: LineStyleType = "solid",
39713971
label: str = "",
39723972
*,

0 commit comments

Comments
 (0)
0