Skip to content

Commit 3c5990a

Browse files
committed
fix annotation function for subplot_spacing==0
1 parent ba423d5 commit 3c5990a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plotly/figure_factory/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ def endpts_to_intervals(endpts):
489489
intervals.append([endpts[length - 1], float('inf')])
490490
return intervals
491491

492+
492493
def annotation_dict_for_label(text, lane, num_of_lanes, subplot_spacing,
493494
row_col='col', flipped=True, right_side=True,
494495
text_color='#0f0f0f'):
@@ -508,7 +509,7 @@ def annotation_dict_for_label(text, lane, num_of_lanes, subplot_spacing,
508509
:param (bool) right_side: only applicable if row_col is set to 'row'.
509510
:param (str) text_color: color of the text.
510511
"""
511-
l = (1 - (num_of_lanes - 1) * subplot_spacing) / (num_of_lanes)
512+
l = (1.0 - (num_of_lanes - 1) * subplot_spacing) / (num_of_lanes)
512513
if not flipped:
513514
xanchor = 'center'
514515
yanchor = 'middle'

0 commit comments

Comments
 (0)