@@ -671,7 +671,6 @@ def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname):
671
671
# Loop through specs -- (r, c) <-> (row, col)
672
672
for r , spec_row in enumerate (specs ):
673
673
for c , spec in enumerate (spec_row ):
674
-
675
674
if spec is None : # skip over None cells
676
675
continue
677
676
@@ -702,6 +701,46 @@ def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname):
702
701
else :
703
702
y_s = grid [r_spanned ][c ][1 ] + spec ["b" ]
704
703
y_e = grid [r ][c ][1 ] + heights [- 1 - r ] - spec ["t" ]
704
+
705
+ if y_s < 0.0 :
706
+ # round for values very close to one
707
+ # handles some floating point errors
708
+ if y_s > - 0.01 :
709
+ y_s = 0.0
710
+ else :
711
+ raise Exception (
712
+ "A combination of the 'b' values, heights, and "
713
+ "number of subplots too large for this subplot grid."
714
+ )
715
+ if y_s > 1.0 :
716
+ # round for values very close to one
717
+ # handles some floating point errors
718
+ if y_s < 1.01 :
719
+ y_s = 1.0
720
+ else :
721
+ raise Exception (
722
+ "A combination of the 'b' values, heights, and "
723
+ "number of subplots too large for this subplot grid."
724
+ )
725
+
726
+ if y_e < 0.0 :
727
+ if y_e > - 0.01 :
728
+ y_e = 0.0
729
+ else :
730
+ raise Exception (
731
+ "A combination of the 't' values, heights, and "
732
+ "number of subplots too large for this subplot grid."
733
+ )
734
+
735
+ if y_e > 1.0 :
736
+ if y_e < 1.01 :
737
+ y_e = 1.0
738
+ else :
739
+ raise Exception (
740
+ "A combination of the 't' values, heights, and "
741
+ "number of subplots too large for this subplot grid."
742
+ )
743
+
705
744
y_domain = [y_s , y_e ]
706
745
707
746
list_of_domains .append (x_domain )
@@ -726,7 +765,6 @@ def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname):
726
765
insets_ref = [None for inset in range (len (insets ))] if insets else None
727
766
if insets :
728
767
for i_inset , inset in enumerate (insets ):
729
-
730
768
r = inset ["cell" ][0 ] - 1
731
769
c = inset ["cell" ][1 ] - 1
732
770
@@ -1052,7 +1090,6 @@ def _subplot_type_for_trace_type(trace_type):
1052
1090
1053
1091
1054
1092
def _validate_coerce_subplot_type (subplot_type ):
1055
-
1056
1093
# Lowercase subplot_type
1057
1094
orig_subplot_type = subplot_type
1058
1095
subplot_type = subplot_type .lower ()
@@ -1200,7 +1237,6 @@ def _build_subplot_title_annotations(
1200
1237
1201
1238
1202
1239
def _build_grid_str (specs , grid_ref , insets , insets_ref , row_seq ):
1203
-
1204
1240
# Compute rows and columns
1205
1241
rows = len (specs )
1206
1242
cols = len (specs [0 ])
@@ -1257,7 +1293,6 @@ def _pad(s, cell_len=cell_len):
1257
1293
# Loop through specs, fill in _tmp
1258
1294
for r , spec_row in enumerate (specs ):
1259
1295
for c , spec in enumerate (spec_row ):
1260
-
1261
1296
ref = grid_ref [r ][c ]
1262
1297
if ref is None :
1263
1298
if _tmp [r ][c ] == "" :
@@ -1339,7 +1374,6 @@ def _pad(s, cell_len=cell_len):
1339
1374
1340
1375
1341
1376
def _set_trace_grid_reference (trace , layout , grid_ref , row , col , secondary_y = False ):
1342
-
1343
1377
if row <= 0 :
1344
1378
raise Exception (
1345
1379
"Row value is out of range. " "Note: the starting cell is (1, 1)"
@@ -1461,7 +1495,6 @@ def _get_grid_subplot(fig, row, col, secondary_y=False):
1461
1495
1462
1496
1463
1497
def _get_subplot_ref_for_trace (trace ):
1464
-
1465
1498
if "domain" in trace :
1466
1499
return SubplotRef (
1467
1500
subplot_type = "domain" ,
0 commit comments