@@ -683,8 +683,17 @@ def test_bar_plt_xaxis_intervalrange(self):
683
683
)
684
684
685
685
686
+ def test_plot_bar_label_count_default ():
687
+ df = DataFrame (
688
+ [(30 , 10 , 10 , 10 ), (20 , 20 , 20 , 20 ), (10 , 30 , 30 , 10 )], columns = list ("ABCD" )
689
+ )
690
+ df .plot (subplots = True , kind = "bar" , title = ["A" , "B" , "C" , "D" ])
691
+
692
+
686
693
def test_plot_bar_label_count_expected_fail ():
687
- df = DataFrame ([(30 , 10 , 10 ), (20 , 20 , 20 ), (10 , 30 , 30 )], columns = list ("ABC" ))
694
+ df = DataFrame (
695
+ [(30 , 10 , 10 , 10 ), (20 , 20 , 20 , 20 ), (10 , 30 , 30 , 10 )], columns = list ("ABCD" )
696
+ )
688
697
with pytest .raises (
689
698
ValueError ,
690
699
match = "The length of `title` must equal the number of columns "
@@ -693,11 +702,12 @@ def test_plot_bar_label_count_expected_fail():
693
702
df .plot (
694
703
subplots = [("A" , "B" )],
695
704
kind = "bar" ,
696
- stacked = True ,
697
- title = ["A&B" , "C" , "Extra Title" ],
705
+ title = ["A&B" , "C" , "D" , "Extra Title" ],
698
706
)
699
707
700
708
701
709
def test_plot_bar_label_count_expected_success ():
702
- df = DataFrame ([(30 , 10 , 10 ), (20 , 20 , 20 ), (10 , 30 , 30 )], columns = list ("ABC" ))
703
- df .plot (subplots = [("A" , "B" )], kind = "bar" , stacked = True , title = ["A&B" , "C" ])
710
+ df = DataFrame (
711
+ [(30 , 10 , 10 , 10 ), (20 , 20 , 20 , 20 ), (10 , 30 , 30 , 10 )], columns = list ("ABCD" )
712
+ )
713
+ df .plot (subplots = [("A" , "B" , "D" )], kind = "bar" , title = ["A&B&D" , "C" ])
0 commit comments