8000 updating inline with review comments · matplotlib/matplotlib@03277e7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 03277e7

Browse files
committed
updating inline with review comments
fixing flake8 errors updating inline with reviewer comments updating inline with reviewer comments
1 parent fda7ed6 commit 03277e7

File tree

3 files changed

+6
-19
lines changed

3 files changed

+6
-19
lines changed

doc/api/next_api_changes/behaviour.rst

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,7 @@ support for it will be dropped in a future Matplotlib release.
156156
Previously, keyword arguments were silently ignored when no positional
157157
arguments were given.
158158

159-
`Axes.vlines` and `Axes.hlines` `color` parameter will now default to configured rcparams `lines.color`
159+
`.Axes.vlines`, `.Axes.hlines`, `.pyplot.vlines` and `.pyplot.hlines` *colors* parameter default change
160160
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161161

162-
Previously the `color` parameter in `Axes.vlines` and `Axes.hlines` would always default to 'k' if not provided.
163-
This was inconsistent with the rest of the API and now `color` will instead default to the configured rcparam's
164-
`lines.color` value, falling back to 'k' if necessary.
165-
166-
`pyplot.vlines` and `pyplot.hlines` `color` parameter will now default to configured rcparams `lines.color`
167-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
168-
169-
Previously the `color` parameter in `pyplot.vlines` and `pyplot.hlines` would always default to 'k' if not provided.
170-
This was inconsistent with the rest of the API and now `color` will instead default to the configured rcparam's
171-
`lines.color` value, falling back to 'k' if necessary.
162+
The *colors* parameter will now default to :rc:`lines.color`, while previously it defaulted to 'k'.

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ def hlines(self, y, xmin, xmax, colors=None, linestyles='solid',
11161116
Respective beginning and end of each line. If scalars are
11171117
provided, all lines will have same length.
11181118
1119-
colors : array-like of colors, default: None
1119+
colors : array-like of colors, default: :rc:`lines.color`
11201120
11211121
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, optional
11221122
@@ -1143,8 +1143,6 @@ def hlines(self, y, xmin, xmax, colors=None, linestyles='solid',
11431143
xmin = self.convert_xunits(xmin)
11441144
xmax = self.convert_xunits(xmax)
11451145

1146-
colors = rcParams['lines.color'] or 'k' if colors is None else colors
1147-
11481146
if not np.iterable(y):
11491147
y = [y]
11501148
if not np.iterable(xmin):
@@ -1200,7 +1198,7 @@ def vlines(self, x, ymin, ymax, colors=None, linestyles='solid',
12001198
Respective beginning and end of each line. If scalars are
12011199
provided, all lines will have same length.
12021200
1203-
colors : array-like of colors, default: None
1201+
colors : array-like of colors, default: :rc:`lines.color`
12041202
12051203
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, optional
12061204
@@ -1227,8 +1225,6 @@ def vlines(self, x, ymin, ymax, colors=None, linestyles='solid',
12271225
ymin = self.convert_yunits(ymin)
12281226
ymax = self.convert_yunits(ymax)
12291227

1230-
colors = rcParams['lines.color'] or 'k' if colors is None else colors
1231-
12321228
if not np.iterable(x):
12331229
x = [x]
12341230
if not np.iterable(ymin):

lib/matplotlib/tests/test_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4008,7 +4008,7 @@ def test_vlines_default(fig_test, fig_ref):
40084008
ax_test = fig_test.subplots()
40094009
ax_ref = fig_ref.subplots()
40104010

4011-
# compare constructing the reference with given value to configured rcParams on test
4011+
# compare constructing ref with given value to configured rcParams on test
40124012
ax_ref.vlines(0.5, 0, 1, colors='red')
40134013
with mpl.rc_context({'lines.color': 'red'}):
40144014
ax_test.vlines(0.5, 0, 1)
@@ -4059,7 +4059,7 @@ def test_hlines_default(fig_test, fig_ref):
40594059
ax_test = fig_test.subplots()
40604060
ax_ref = fig_ref.subplots()
40614061

4062-
# compare constructing the reference with given value to configured rcParams on test
4062+
# compare constructing ref with given value to configured rcParams on test
40634063
ax_ref.hlines(0.5, 0, 1, colors='red')
40644064
with mpl.rc_context({'lines.color': 'red'}):
40654065
ax_test.hlines(0.5, 0, 1)

0 commit comments

Comments
 (0)
0