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 @@ -829,8 +829,9 @@ def test_plot_bar_label_count_expected_fail():
829
829
)
830
830
with pytest .raises (
831
831
ValueError ,
832
- match = "The length of `title` must equal the number of columns "
833
- "if using `title` of type `list` and `subplots=True`." ,
832
+ match = "The length of `title` must equal the number "
833
+ "of subplots if `title` of type `list` "
834
+ "and subplots is iterable.\n " ,
834
835
):
835
836
df .plot (
836
837
subplots = [("A" , "B" )],
You can’t perform that action at this time.
0 commit comments