tools.make_subplots with colspan/rowspan fails when using sharex/sharey
See original GitHub issueHi, i am trying to create subplots with colspan/rowspan attribute and shared_xaxes using the code below (Plotly 3.3). As soon as i use the shared_xaxes=True parameter, the code fails with the error message:
Exception: Something went wrong. An axis object for (2,4) subplot cell got deleted.
Example code:
from plotly import tools
import plotly
import plotly.plotly as py
import plotly.graph_objs as go
trace1 = go.Scatter(
x=[0, 1, 2],
y=[10, 11, 12]
)
trace2 = go.Scatter(
x=[2, 3, 4],
y=[100, 110, 120],
)
trace3 = go.Scatter(
x=[2, 3, 4],
y=[100, 110, 120],
)
fig = tools.make_subplots(rows=3, cols=4, specs=[[{'colspan':3}, None, None, None],
[{'rowspan':2, 'colspan':3}, None, None, {'rowspan':2}],
[None, None, None, None]],
shared_xaxes=True, shared_yaxes=True,
vertical_spacing=0.001)
print(fig['layout'])
fig.append_trace(trace1, 1, 1)
fig.append_trace(trace2, 2, 1)
fig.append_trace(trace3, 2, 4)
print(fig['layout'])
fig['layout'].update(height=600, width=600, title='Stacked Subplots with Shared X-Axes')
plotly.offline.iplot(fig, filename='test')
Cheers, Georg
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (1 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@empet Nope. Even adding a vertically aligned subplot+trace does not help:
@jonmmease this issue can be closed.