@@ -3998,12 +3998,12 @@ def generate_lines_with_colors_inputs():
3998
3998
xy_mask = np .ma .masked_equal ([1 , 2 , 3 , 4 , 5 ], 4 )
3999
3999
lines_nan = [{'base_xy' : xy_nan ,
4000
4000
'base_max' : np .ones (5 ),
4001
- 'base_min' : 0 ,
4001
+ 'base_min' : [ 0 ] ,
4002
4002
'linewidth' : 5 ,
4003
4003
'colors' : colors }]
4004
4004
lines_mask = [{'base_xy' : xy_mask ,
4005
4005
'base_max' : np .ones (5 ),
4006
- 'base_min' : 0 ,
4006
+ 'base_min' : [ 0 ] ,
4007
4007
'linewidth' : 5 ,
4008
4008
'colors' : colors }]
4009
4009
@@ -4013,41 +4013,36 @@ def generate_lines_with_colors_inputs():
4013
4013
@pytest .mark .parametrize ('kwargs' , generate_lines_with_colors_inputs ())
4014
4014
@check_figures_equal (extensions = ["png" ])
4015
4015
def test_vlines_with_colors (fig_test , fig_ref , kwargs ):
4016
- fig_test , ax0 = plt .subplots ()
4017
4016
kwargs ['x' ] = kwargs .pop ('base_xy' )
4018
4017
kwargs ['ymin' ] = kwargs .pop ('base_min' )
4019
4018
kwargs ['ymax' ] = kwargs .pop ('base_max' )
4020
- ax0 .vlines (** kwargs )
4019
+ fig_test . subplots () .vlines (** kwargs )
4021
4020
4022
4021
expect = {
4023
4022
'x' : [1 , 2 , 3 , 5 ],
4024
- 'ymin' : 0 ,
4025
- 'ymax' : [ 1 , 2 , 3 , 5 ] ,
4023
+ 'ymin' : [ 0 ] ,
4024
+ 'ymax' : np . ones ( 4 ) ,
4026
4025
'colors' : ['red' , 'green' , 'blue' , 'orange' ],
4027
4026
'linewidth' : 5 }
4028
-
4029
- fig_ref , ax1 = plt .subplots ()
4030
- ax1 .vlines (** expect )
4027
+ fig_ref .subplots ().vlines (** expect )
4031
4028
4032
4029
4033
4030
@pytest .mark .parametrize ('kwargs' , generate_lines_with_colors_inputs ())
4034
4031
@check_figures_equal (extensions = ["png" ])
4035
4032
def test_hlines_with_colors (fig_test , fig_ref , kwargs ):
4036
- fig_test , ax0 = plt .subplots ()
4037
4033
kwargs ['y' ] = kwargs .pop ('base_xy' )
4038
4034
kwargs ['xmin' ] = kwargs .pop ('base_min' )
4039
4035
kwargs ['xmax' ] = kwargs .pop ('base_max' )
4040
- ax0 .hlines (** kwargs )
4036
+ fig_test . subplots () .hlines (** kwargs )
4041
4037
4042
4038
expect = {
4043
4039
'y' : [1 , 2 , 3 , 5 ],
4044
- 'xmin' : 0 ,
4045
- 'xmax' : [ 1 , 2 , 3 , 5 ] ,
4040
+ 'xmin' : [ 0 ] ,
4041
+ 'xmax' : np . ones ( 4 ) ,
4046
4042
'colors' : ['red' , 'green' , 'blue' , 'orange' ],
4047
4043
'linewidth' : 5 }
4048
4044
4049
- fig_ref , ax1 = plt .subplots ()
4050
- ax1 .hlines (** expect )
4045
+ fig_ref .subplots ().hlines (** expect )
4051
4046
4052
4047
4053
4048
@image_comparison (['step_linestyle' , 'step_linestyle' ], remove_text = True )
0 commit comments