@@ -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
@@ -703,6 +702,16 @@ def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname):
703
702
y_s = grid [r_spanned ][c ][1 ] + spec ["b" ]
704
703
y_e = grid [r ][c ][1 ] + heights [- 1 - r ] - spec ["t" ]
705
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
+ )
706
715
if y_s > 1.0 :
707
716
# round for values very close to one
708
717
# handles some floating point errors
@@ -713,6 +722,16 @@ def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname):
713
722
"A combination of the 'b' values, heights, and "
714
723
"number of subplots too large for this subplot grid."
715
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
+
716
735
if y_e > 1.0 :
717
736
if y_e < 1.01 :
718
737
y_e = 1.0
@@ -746,7 +765,6 @@ def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname):
746
765
insets_ref = [None for inset in range (len (insets ))] if insets else None
747
766
if insets :
748
767
for i_inset , inset in enumerate (insets ):
749
-
750
768
r = inset ["cell" ][0 ] - 1
751
769
c = inset ["cell" ][1 ] - 1
752
770
@@ -1072,7 +1090,6 @@ def _subplot_type_for_trace_type(trace_type):
1072
1090
1073
1091
1074
1092
def _validate_coerce_subplot_type (subplot_type ):
1075
-
1076
1093
# Lowercase subplot_type
1077
1094
orig_subplot_type = subplot_type
1078
1095
subplot_type = subplot_type .lower ()
@@ -1220,7 +1237,6 @@ def _build_subplot_title_annotations(
1220
1237
1221
1238
1222
1239
def _build_grid_str (specs , grid_ref , insets , insets_ref , row_seq ):
1223
-
1224
1240
# Compute rows and columns
1225
1241
rows = len (specs )
1226
1242
cols = len (specs [0 ])
@@ -1277,7 +1293,6 @@ def _pad(s, cell_len=cell_len):
1277
1293
# Loop through specs, fill in _tmp
1278
1294
for r , spec_row in enumerate (specs ):
1279
1295
for c , spec in enumerate (spec_row ):
1280
-
1281
1296
ref = grid_ref [r ][c ]
1282
1297
if ref is None :
1283
1298
if _tmp [r ][c ] == "" :
@@ -1359,7 +1374,6 @@ def _pad(s, cell_len=cell_len):
1359
1374
1360
1375
1361
1376
def _set_trace_grid_reference (trace , layout , grid_ref , row , col , secondary_y = False ):
1362
-
1363
1377
if row <= 0 :
1364
1378
raise Exception (
1365
1379
"Row value is out of range. " "Note: the starting cell is (1, 1)"
@@ -1481,7 +1495,6 @@ def _get_grid_subplot(fig, row, col, secondary_y=False):
1481
1495
1482
1496
1483
1497
def _get_subplot_ref_for_trace (trace ):
1484
-
1485
1498
if "domain" in trace :
1486
1499
return SubplotRef (
1487
1500
subplot_type = "domain" ,
0 commit comments