Skip to content

Commit af67e90

Browse files
committed
replace 'columns' with 'cols'
1 parent 421dd5f commit af67e90

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

plotly/tools.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -644,11 +644,11 @@ def make_subplots(rows=1, cols=1,
644644
in fraction of cell height ('to_end': to cell top edge)
645645
"""
646646

647-
# Throw exception for non-integer rows and columns
647+
# Throw exception for non-integer rows and cols
648648
if not isinstance(rows, int):
649649
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")
652652

653653
# Throw exception if non-valid kwarg is sent
654654
VALID_KWARGS = ['horizontal_spacing', 'vertical_spacing',
@@ -657,11 +657,11 @@ def make_subplots(rows=1, cols=1,
657657
if key not in VALID_KWARGS:
658658
raise Exception("Invalid keyword argument: '{0}'".format(key))
659659

660-
# Set 'horizontal_spacing' / 'vertical_spacing' w.r.t. rows / columns
660+
# Set 'horizontal_spacing' / 'vertical_spacing' w.r.t. rows / cols
661661
try:
662662
horizontal_spacing = float(kwargs['horizontal_spacing'])
663663
except KeyError:
664-
horizontal_spacing = 0.2 / columns
664+
horizontal_spacing = 0.2 / cols
665665
try:
666666
vertical_spacing = float(kwargs['vertical_spacing'])
667667
except KeyError:
@@ -677,17 +677,17 @@ def make_subplots(rows=1, cols=1,
677677
specs = [specs]
678678
except KeyError:
679679
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'
682682

683683
# Throw exception if specs is over or under specified
684684
if len(specs) != rows:
685685
raise Exception("The number of rows in 'specs' "
686686
"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:
689689
raise Exception("The number of columns in 'specs' "
690-
"must be equal to 'columns'")
690+
"must be equal to 'cols'")
691691

692692
# Sanitize 'insets'
693693
try:
@@ -740,7 +740,7 @@ def _checks(item, defaults):
740740
_check_keys_and_fill('insets', insets, INSET_defaults)
741741

742742
# 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
744744
height = (1. - vertical_spacing * (rows - 1)) / rows
745745

746746
# Build subplot grid (tuple of starting coords for each cell)

0 commit comments

Comments
 (0)