@@ -635,7 +635,7 @@ def test_pie_series(self):
635
635
series = Series ([1 , 2 , np .nan , 4 ],
636
636
index = ['a' , 'b' , 'c' , 'd' ], name = 'YLABEL' )
637
637
ax = _check_plot_works (series .plot , kind = 'pie' )
638
- self ._check_text_labels (ax .texts , series . index )
638
+ self ._check_text_labels (ax .texts , [ 'a' , 'b' , '' , 'd' ] )
639
639
640
640
def test_pie_nan (self ):
641
641
s = Series ([1 , np .nan , 1 , 1 ])
@@ -2798,13 +2798,17 @@ def test_pie_df_nan(self):
2798
2798
2799
2799
base_expected = ['0' , '1' , '2' , '3' ]
2800
2800
for i , ax in enumerate (axes ):
2801
- expected = list (base_expected ) # copy
2801
+ expected = list (base_expected ) # force copy
2802
2802
expected [i ] = ''
2803
2803
result = [x .get_text () for x in ax .texts ]
2804
2804
self .assertEqual (result , expected )
2805
2805
# legend labels
2806
- self .assertEqual ([x .get_text () for x in ax .get_legend ().get_texts ()],
2807
- base_expected )
2806
+ # NaN's not included in legend with subplots
2807
+ # see https://github.com/pydata/pandas/issues/8390
2808
+ self .assertEqual ([x .get_text () for x in
2809
+ ax .get_legend ().get_texts ()],
2810
+ base_expected [:i ] + base_expected [i + 1 :])
2811
+
2808
2812
def test_errorbar_plot (self ):
2809
2813
d = {'x' : np .arange (12 ), 'y' : np .arange (12 , 0 , - 1 )}
2810
2814
df = DataFrame (d )
0 commit comments