@@ -644,11 +644,11 @@ def make_subplots(rows=1, cols=1,
644
644
in fraction of cell height ('to_end': to cell top edge)
645
645
"""
646
646
647
- # Throw exception for non-integer rows and columns
647
+ # Throw exception for non-integer rows and cols
648
648
if not isinstance (rows , int ):
649
649
raise Exception ("Keyword argument 'rows' must be an int" )
650
- if not isinstance (columns , int ):
651
- raise Exception ("Keyword argument 'columns ' must be an int" )
650
+ if not isinstance (cols , int ):
651
+ raise Exception ("Keyword argument 'cols ' must be an int" )
652
652
653
653
# Throw exception if non-valid kwarg is sent
654
654
VALID_KWARGS = ['horizontal_spacing' , 'vertical_spacing' ,
@@ -657,11 +657,11 @@ def make_subplots(rows=1, cols=1,
657
657
if key not in VALID_KWARGS :
658
658
raise Exception ("Invalid keyword argument: '{0}'" .format (key ))
659
659
660
- # Set 'horizontal_spacing' / 'vertical_spacing' w.r.t. rows / columns
660
+ # Set 'horizontal_spacing' / 'vertical_spacing' w.r.t. rows / cols
661
661
try :
662
662
horizontal_spacing = float (kwargs ['horizontal_spacing' ])
663
663
except KeyError :
664
- horizontal_spacing = 0.2 / columns
664
+ horizontal_spacing = 0.2 / cols
665
665
try :
666
666
vertical_spacing = float (kwargs ['vertical_spacing' ])
667
667
except KeyError :
@@ -677,17 +677,17 @@ def make_subplots(rows=1, cols=1,
677
677
specs = [specs ]
678
678
except KeyError :
679
679
specs = [[{}
680
- for col in range (columns )]
681
- for row in range (rows )] # default 'specs'
680
+ for c in range (cols )]
681
+ for r in range (rows )] # default 'specs'
682
682
683
683
# Throw exception if specs is over or under specified
684
684
if len (specs ) != rows :
685
685
raise Exception ("The number of rows in 'specs' "
686
686
"must be equal to 'rows'" )
687
- for spec_row in specs :
688
- if len (spec_row ) != columns :
687
+ for r , spec_row in enumerate ( specs ) :
688
+ if len (spec_row ) != cols :
689
689
raise Exception ("The number of columns in 'specs' "
690
- "must be equal to 'columns '" )
690
+ "must be equal to 'cols '" )
691
691
692
692
# Sanitize 'insets'
693
693
try :
@@ -740,7 +740,7 @@ def _checks(item, defaults):
740
740
_check_keys_and_fill ('insets' , insets , INSET_defaults )
741
741
742
742
# Set width & height of each subplot cell (excluding padding)
743
- width = (1. - horizontal_spacing * (columns - 1 )) / columns
743
+ width = (1. - horizontal_spacing * (cols - 1 )) / cols
744
744
height = (1. - vertical_spacing * (rows - 1 )) / rows
745
745
746
746
# Build subplot grid (tuple of starting coords for each cell)
0 commit comments