-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
When I try to add another yaxis to the layout imperatively, the traces in the original yaxis seem to dissapear, here's a minimal example:
fig = go.FigureWidget()
trace1 = go.Bar()
trace1.x = [1, 2, 3, 4]
trace1.y = [1, 2, 3, 4]
trace1.yaxis = 'y1'
fig.add_trace(trace1)
trace2 = go.Scatter()
trace2.x = [1, 2, 3, 4]
trace2.y = [1, 2, 3, 4]
trace2.yaxis = 'y2'
fig.add_trace(trace2)
fig.layout['yaxis2'] = go.layout.YAxis()
fig.layout.yaxis2.side = 'right'
fig
I'm not so comfortable with fig.layout['yaxis2'] = go.layout.YAxis() also, it might be the root of the issue. Maybe a method to add an axis would be nice.
I'm loving version 3 btw.
Metadata
Metadata
Assignees
Labels
No labels