@@ -779,21 +779,21 @@ def test_nonfinite_limits():
779
779
ax .plot (x , y )
780
780
781
781
782
- @pytest .mark .parametrize ('plot_fun, lims' ,
783
- [[plt .plot , (14610.0 , 14974.0 )],
784
- [plt .scatter , (14591.8 , 14992.2 )]])
785
- def test_limits_empty_data (plot_fun , lims ):
782
+ @pytest .mark .style ('default' )
783
+ @pytest .mark .parametrize ('plot_fun' ,
784
+ ['scatter' , 'plot' , 'fill_between' ])
785
+ @check_figures_equal (extensions = ["png" ])
786
+ def test_limits_empty_data (plot_fun , fig_test , fig_ref ):
786
787
# Check that plotting empty data doesn't change autoscaling of dates
787
788
x = np .arange ("2010-01-01" , "2011-01-01" , dtype = "datetime64[D]" )
788
789
789
- fig , ax = plt .subplots ()
790
- plot_fun (x , np .arange (len (x )))
791
- assert ax .get_xlim () == lims
790
+ ax_test = fig_test .subplots ()
791
+ ax_ref = fig_ref .subplots ()
792
792
793
- fig , ax = plt . subplots ( )
794
- plot_fun ([], [])
795
- plot_fun ( x , np . arange ( len ( x )))
796
- assert ax . get_xlim () == lims
793
+ getattr ( ax_test , plot_fun )([], [] )
794
+
795
+ for ax in [ ax_test , ax_ref ]:
796
+ getattr ( ax , plot_fun )( x , range ( len ( x )), color = 'C0' )
797
797
798
798
799
799
@image_comparison (['imshow' , 'imshow' ], remove_text = True , style = 'mpl20' )
0 commit comments