@@ -725,6 +725,45 @@ def test_polycollection_joinstyle():
725725 ax .set_ybound (0 , 3 )
726726
727727
728+ @cleanup
729+ def test_fill_between_2d_x_input ():
730+ x = np .zeros ((2 , 2 ))
731+ y1 = 3
732+ y2 = 3
733+
734+ fig = plt .figure ()
735+ ax = fig .add_subplot (211 )
736+ with pytest .raises (ValueError ):
737+ ax .plot (x , y1 , x , y2 , color = 'black' )
738+ ax .fill_between (x , y1 , y2 )
739+
740+
741+ @cleanup
742+ def test_fill_between_2d_y1_input ():
743+ x = np .arange (0.0 , 2 , 0.02 )
744+ y1 = np .zeros ((2 , 2 ))
745+ y2 = 3
746+
747+ fig = plt .figure ()
748+ ax = fig .add_subplot (211 )
749+ with pytest .raises (ValueError ):
750+ ax .plot (x , y1 , x , y2 , color = 'black' )
751+ ax .fill_between (x , y1 , y2 )
752+
753+
754+ @cleanup
755+ def test_fill_between_2d_y2_input ():
756+ x = np .arange (0.0 , 2 , 0.02 )
757+ y1 = 3
758+ y2 = np .zeros ((2 , 2 ))
759+
760+ fig = plt .figure ()
761+ ax = fig .add_subplot (211 )
762+ with pytest .raises (ValueError ):
763+ ax .plot (x , y1 , x , y2 , color = 'black' )
764+ ax .fill_between (x , y1 , y2 )
765+
766+
728767@image_comparison (baseline_images = ['fill_between_interpolate' ],
729768 remove_text = True )
730769def test_fill_between_interpolate ():
@@ -4801,6 +4840,45 @@ def test_tick_param_label_rotation():
48014840 assert text .get_rotation () == 90
48024841
48034842
4843+ @cleanup
4844+ def test_fill_betweenx_2d_y_input ():
4845+ y = np .zeros ((2 , 2 ))
4846+ x1 = 3
4847+ x2 = 3
4848+
4849+ fig = plt .figure ()
4850+ ax = fig .add_subplot (211 )
4851+ with pytest .raises (ValueError ):
4852+ ax .plot (y , x1 , y , x2 , color = 'black' )
4853+ ax .fill_betweenx (y , x1 , x2 )
4854+
4855+
4856+ @cleanup
4857+ def test_fill_betweenx_2d_x1_input ():
4858+ y = np .arange (0.0 , 2 , 0.02 )
4859+ x1 = np .zeros ((2 , 2 ))
4860+ x2 = 3
4861+
4862+ fig = plt .figure ()
4863+ ax = fig .add_subplot (211 )
4864+ with pytest .raises (ValueError ):
4865+ ax .plot (y , x1 , y , x2 , color = 'black' )
4866+ ax .fill_betweenx (y , x1 , x2 )
4867+
4868+
4869+ @cleanup
4870+ def test_fill_betweenx_2d_x2_input ():
4871+ y = np .arange (0.0 , 2 , 0.02 )
4872+ x1 = 3
4873+ x2 = np .zeros ((2 , 2 ))
4874+
4875+ fig = plt .figure ()
4876+ ax = fig .add_subplot (211 )
4877+ with pytest .raises (ValueError ):
4878+ ax .plot (y , x1 , y , x2 , color = 'black' )
4879+ ax .fill_betweenx (y , x1 , x2 )
4880+
4881+
48044882@cleanup (style = 'default' )
48054883def test_fillbetween_cycle ():
48064884 fig , ax = plt .subplots ()
0 commit comments