Skip to content

Commit a0df901

Browse files
committed
fix facet_grid ff - annotations and shapes are now tuples
1 parent b992c9f commit a0df901

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: plotly/figure_factory/_facet_grid.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ def _axis_title_annotation(text, x_or_y_axis):
143143

144144
def _add_shapes_to_fig(fig, annot_rect_color, flipped_rows=False,
145145
flipped_cols=False):
146-
fig['layout']['shapes'] = []
147-
for key in fig['layout'].keys():
146+
shapes_list = []
147+
for key in fig['layout'].to_plotly_json().keys():
148148
if 'axis' in key and fig['layout'][key]['domain'] != [0.0, 1.0]:
149149
shape = {
150150
'fillcolor': annot_rect_color,
@@ -163,7 +163,7 @@ def _add_shapes_to_fig(fig, annot_rect_color, flipped_rows=False,
163163

164164
if flipped_cols:
165165
shape['y1'] += 0.5
166-
fig['layout']['shapes'].append(shape)
166+
shapes_list.append(shape)
167167

168168
elif 'yaxis' in key:
169169
shape['x0'] = 1.005
@@ -173,7 +173,9 @@ def _add_shapes_to_fig(fig, annot_rect_color, flipped_rows=False,
173173

174174
if flipped_rows:
175175
shape['x1'] += 1
176-
fig['layout']['shapes'].append(shape)
176+
shapes_list.append(shape)
177+
178+
fig['layout']['shapes'] = shapes_list
177179

178180

179181
def _make_trace_for_scatter(trace, trace_type, color, **kwargs_marker):

0 commit comments

Comments
 (0)