Skip to content

Commit ebb3808

Browse files
committed
fixed bug for issue plotly#3755 when the figure object does not contain subplots
1 parent cc94803 commit ebb3808

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Diff for: packages/python/plotly/plotly/basedatatypes.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -4060,10 +4060,13 @@ def _process_multiple_axis_spanning_shapes(
40604060
):
40614061
# this was called intending to add to a single plot (and
40624062
# self.add_{layout_obj} succeeded)
4063-
# however, in the case of a single plot, xref and yref are not
4064-
# specified, so we specify them here so the following routines can work
4063+
# however, in the case of a single plot, xref and yref MAY not be
4064+
# specified, IF they are not specified we specify them here so the following routines can work
40654065
# (they need to append " domain" to xref or yref)
4066-
self.layout[layout_obj][-1].update(xref="x", yref="y")
4066+
if self.layout[layout_obj][-1].xref is None:
4067+
self.layout[layout_obj][-1].update(xref="x")
4068+
if self.layout[layout_obj][-1].yref is None:
4069+
self.layout[layout_obj][-1].update(yref="y")
40674070
new_layout_objs = tuple(
40684071
filter(
40694072
lambda x: x is not None,

0 commit comments

Comments
 (0)