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

Skip to content

Commit 56a7512

Browse files
committed
updating inline with review comments
fixing flake8 errors updating inline with reviewer comments updating inline with reviewer comments
1 parent 2d6d820 commit 56a7512

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

doc/api/api_changes_3.3/behaviour.rst

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -275,16 +275,8 @@ instead of ::
275275
<a list of 3 Lists of Patches objects> # "bar", "barstacked"
276276
<a list of 3 Lists of Patches objects> # "step", "stepfilled"
277277

278-
`Axes.vlines` and `Axes.hlines` `color` parameter will now default to configured rcparams `lines.color`
279-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
280-
281-
Previously the `color` parameter in `Axes.vlines` and `Axes.hlines` would always default to 'k' if not provided.
282-
This was inconsistent with the rest of the API and now `color` will instead default to the configured rcparam's
283-
`lines.color` value, falling back to 'k' if necessary.
284278

285-
`pyplot.vlines` and `pyplot.hlines` `color` parameter will now default to configured rcparams `lines.color`
279+
`.Axes.vlines`, `.Axes.hlines`, `.pyplot.vlines` and `.pyplot.hlines` *colors* parameter default change
286280
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
287281

288-
Previously the `color` parameter in `pyplot.vlines` and `pyplot.hlines` would always default to 'k' if not provided.
289-
This was inconsistent with the rest of the API and now `color` will instead default to the configured rcparam's
290-
`lines.color` value, falling back to 'k' if necessary.
282+
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
@@ -1130,7 +1130,7 @@ def hlines(self, y, xmin, xmax, colors=None, linestyles='solid',
11301130
Respective beginning and end of each line. If scalars are
11311131
provided, all lines will have same length.
11321132
1133-
colors : array-like of colors, default: None
1133+
colors : array-like of colors, default: :rc:`lines.color`
11341134
11351135
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, optional
11361136
@@ -1157,8 +1157,6 @@ def hlines(self, y, xmin, xmax, colors=None, linestyles='solid',
11571157
xmin = self.convert_xunits(xmin)
11581158
xmax = self.convert_xunits(xmax)
11591159

1160-
colors = rcParams['lines.color'] or 'k' if colors is None else colors
1161-
11621160
if not np.iterable(y):
11631161
y = [y]
11641162
if not np.iterable(xmin):
@@ -1214,7 +1212,7 @@ def vlines(self, x, ymin, ymax, colors=None, linestyles='solid',
12141212
Respective beginning and end of each line. If scalars are
12151213
provided, all lines will have same length.
12161214
1217-
colors : array-like of colors, default: None
1215+
colors : array-like of colors, default: :rc:`lines.color`
12181216
12191217
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, optional
12201218
@@ -1241,8 +1239,6 @@ def vlines(self, x, ymin, ymax, colors=None, linestyles='solid',
12411239
ymin = self.convert_yunits(ymin)
12421240
ymax = self.convert_yunits(ymax)
12431241

1244-
colors = rcParams['lines.color'] or 'k' if colors is None else colors
1245-
12461242
if not np.iterable(x):
12471243
x = [x]
12481244
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
@@ -3790,7 +3790,7 @@ def test_vlines_default(fig_test, fig_ref):
37903790
ax_test = fig_test.subplots()
37913791
ax_ref = fig_ref.subplots()
37923792

3793-
# compare constructing the reference with given value to configured rcParams on test
3793+
# compare constructing ref with given value to configured rcParams on test
37943794
ax_ref.vlines(0.5, 0, 1, colors='red')
37953795
with mpl.rc_context({'lines.color': 'red'}):
37963796
ax_test.vlines(0.5, 0, 1)
@@ -3841,7 +3841,7 @@ def test_hlines_default(fig_test, fig_ref):
38413841
ax_test = fig_test.subplots()
38423842
ax_ref = fig_ref.subplots()
38433843

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

0 commit comments

Comments
 (0)
0