File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -802,7 +802,16 @@ def _adorn_subplots(self, fig: Figure) -> None:
802
802
if self .title :
803
803
if self .subplots :
804
804
if is_list_like (self .title ):
805
- if len (self .title ) != self .nseries :
805
+ if type (self .subplots ) != bool :
806
+ if len (self .subplots ) != len (self .title ):
807
+ raise ValueError (
808
+ "The length of `title` must equal the number "
809
+ "of subplots if `title` of type `list` "
810
+ "and subplots is iterable.\n "
811
+ f"length of title = { len (self .title )} \n "
812
+ f"number of subplots = { len (self .subplots )} "
813
+ )
814
+ elif len (self .title ) != self .nseries :
806
815
raise ValueError (
807
816
"The length of `title` must equal the number "
808
817
"of columns if using `title` of type `list` "
Original file line number Diff line number Diff line change @@ -696,8 +696,9 @@ def test_plot_bar_label_count_expected_fail():
696
696
)
697
697
with pytest .raises (
698
698
ValueError ,
699
- match = "The length of `title` must equal the number of columns "
700
- "if using `title` of type `list` and `subplots=True`." ,
699
+ match = "The length of `title` must equal the number "
700
+ "of subplots if `title` of type `list` "
701
+ "and subplots is iterable.\n " ,
701
702
):
702
703
df .plot (
703
704
subplots = [("A" , "B" )],
You can’t perform that action at this time.
0 commit comments