@@ -401,19 +401,19 @@ def get_subplots(rows=1, columns=1, print_grid=False, **kwargs):
401
401
402
402
Keywords arguments with constant defaults:
403
403
404
- rows (int, default=1):
404
+ rows (kwarg, int greater than 0 , default=1):
405
405
Number of rows, evenly spaced vertically on the figure.
406
406
407
- columns (int, default=1):
407
+ columns (kwarg, int greater than 0 , default=1):
408
408
Number of columns, evenly spaced horizontally on the figure.
409
409
410
- horizontal_spacing (float in [0,1], default=0.1):
410
+ horizontal_spacing (kwarg, float in [0,1], default=0.1):
411
411
Space between subplot columns. Applied to all columns.
412
412
413
- vertical_spacing (float in [0,1], default=0.05):
413
+ vertical_spacing (kwarg, float in [0,1], default=0.05):
414
414
Space between subplot rows. Applied to all rows.
415
415
416
- print_grid (True | False, default=False):
416
+ print_grid (kwarg, True | False, default=False):
417
417
If True, prints a tab-delimited string representation
418
418
of your plot grid.
419
419
@@ -433,10 +433,12 @@ def get_subplots(rows=1, columns=1, print_grid=False, **kwargs):
433
433
)
434
434
435
435
# Throw exception for non-integer rows and columns
436
- if not isinstance (rows , int ):
437
- raise Exception ("Keyword argument 'rows' must be an int" )
438
- if not isinstance (columns , int ):
439
- raise Exception ("Keyword argument 'columns' must be an int" )
436
+ if not isinstance (rows , int ) or rows <= 0 :
437
+ raise Exception ("Keyword argument 'rows' "
438
+ "must be an int greater than 0" )
439
+ if not isinstance (columns , int ) or columns <= 0 :
440
+ raise Exception ("Keyword argument 'columns' "
441
+ "must be an int greater than 0" )
440
442
441
443
# Throw exception if non-valid kwarg is sent
442
444
VALID_KWARGS = ['horizontal_spacing' , 'vertical_spacing' ]
@@ -550,10 +552,10 @@ def make_subplots(rows=1, cols=1,
550
552
551
553
Keywords arguments with constant defaults:
552
554
553
- rows (kwarg, int, default=1):
555
+ rows (kwarg, int greater than 0 , default=1):
554
556
Number of rows in the subplot grid.
555
557
556
- cols (kwarg, int, default=1):
558
+ cols (kwarg, int greater than 0 , default=1):
557
559
Number of columns in the subplot grid.
558
560
559
561
shared_xaxes (kwarg, boolean or list, default=False)
@@ -651,10 +653,12 @@ def make_subplots(rows=1, cols=1,
651
653
"""
652
654
653
655
# Throw exception for non-integer rows and cols
654
- if not isinstance (rows , int ):
655
- raise Exception ("Keyword argument 'rows' must be an int" )
656
- if not isinstance (cols , int ):
657
- raise Exception ("Keyword argument 'cols' must be an int" )
656
+ if not isinstance (rows , int ) or rows <= 0 :
657
+ raise Exception ("Keyword argument 'rows' "
658
+ "must be an int greater than 0" )
659
+ if not isinstance (cols , int ) or cols <= 0 :
660
+ raise Exception ("Keyword argument 'cols' "
661
+ "must be an int greater than 0" )
658
662
659
663
# Dictionary of things start_cell
660
664
START_CELL_all = {
0 commit comments