Skip to content

Commit 0322cbd

Browse files
committed
fix build failed
1 parent 2e790f1 commit 0322cbd

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3998,12 +3998,12 @@ def generate_lines_with_colors_inputs():
39983998
xy_mask = np.ma.masked_equal([1, 2, 3, 4, 5], 4)
39993999
lines_nan = [{'base_xy': xy_nan,
40004000
'base_max': np.ones(5),
4001-
'base_min': 0,
4001+
'base_min': [0],
40024002
'linewidth': 5,
40034003
'colors': colors}]
40044004
lines_mask = [{'base_xy': xy_mask,
40054005
'base_max': np.ones(5),
4006-
'base_min': 0,
4006+
'base_min': [0],
40074007
'linewidth': 5,
40084008
'colors': colors}]
40094009

@@ -4013,41 +4013,36 @@ def generate_lines_with_colors_inputs():
40134013
@pytest.mark.parametrize('kwargs', generate_lines_with_colors_inputs())
40144014
@check_figures_equal(extensions=["png"])
40154015
def test_vlines_with_colors(fig_test, fig_ref, kwargs):
4016-
fig_test, ax0 = plt.subplots()
40174016
kwargs['x'] = kwargs.pop('base_xy')
40184017
kwargs['ymin'] = kwargs.pop('base_min')
40194018
kwargs['ymax'] = kwargs.pop('base_max')
4020-
ax0.vlines(**kwargs)
4019+
fig_test.subplots().vlines(**kwargs)
40214020

40224021
expect = {
40234022
'x': [1, 2, 3, 5],
4024-
'ymin': 0,
4025-
'ymax': [1, 2, 3, 5],
4023+
'ymin': [0],
4024+
'ymax': np.ones(4),
40264025
'colors': ['red', 'green', 'blue', 'orange'],
40274026
'linewidth': 5}
4028-
4029-
fig_ref, ax1 = plt.subplots()
4030-
ax1.vlines(**expect)
4027+
fig_ref.subplots().vlines(**expect)
40314028

40324029

40334030
@pytest.mark.parametrize('kwargs', generate_lines_with_colors_inputs())
40344031
@check_figures_equal(extensions=["png"])
40354032
def test_hlines_with_colors(fig_test, fig_ref, kwargs):
4036-
fig_test, ax0 = plt.subplots()
40374033
kwargs['y'] = kwargs.pop('base_xy')
40384034
kwargs['xmin'] = kwargs.pop('base_min')
40394035
kwargs['xmax'] = kwargs.pop('base_max')
4040-
ax0.hlines(**kwargs)
4036+
fig_test.subplots().hlines(**kwargs)
40414037

40424038
expect = {
40434039
'y': [1, 2, 3, 5],
4044-
'xmin': 0,
4045-
'xmax': [1, 2, 3, 5],
4040+
'xmin': [0],
4041+
'xmax': np.ones(4),
40464042
'colors': ['red', 'green', 'blue', 'orange'],
40474043
'linewidth': 5}
40484044

4049-
fig_ref, ax1 = plt.subplots()
4050-
ax1.hlines(**expect)
4045+
fig_ref.subplots().hlines(**expect)
40514046

40524047

40534048
@image_comparison(['step_linestyle', 'step_linestyle'], remove_text=True)

0 commit comments

Comments
 (0)