Can't draw spike line across subplots with make_subplots in 4.0.0
See original GitHub issueAfter upgrading to plotly 4.0.0, I can’t see how to create a spike line across shared axes created with make_subplots.
Previously I was using code like this:
from plotly.tools import make_subplots
from plotly.io import write_html
fig = make_subplots(rows=4, cols=1, shared_xaxes=True)
x_vals = list(range(10))
y_vals = [x**2 for x in x_vals]
fig.add_scatter(x=x_vals, y=y_vals, row=1, col=1)
fig.add_scatter(x=x_vals, y=y_vals, row=2, col=1)
fig.add_scatter(x=x_vals, y=y_vals, row=3, col=1)
fig.add_scatter(x=x_vals, y=y_vals, row=4, col=1)
fig.update_xaxes(spikemode='across+marker')
write_html(fig, 'out.html', auto_open=True)
The resulting figure showed spike lines across axes because only one x axis was created:
But in 4.0, multiple x axes are created so the spike line no longer draws across all subplots:
Is there any way around this? Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Plotly Spikes Not Appearing on Subplots - Stack Overflow
I am making a figure with multiple subplots. I want each subplot to show spikes but am unable to get the spikes showing...
Read more >Is it possible making spike lines in several subplots having 2 ...
Is there any method applying vertical spike line sharing x-axis in all ... Can't draw spike line across subplots with make_subplots in 4.0.0....
Read more >Plotly Subplots & Plot Layering - Medium
So we can not use make_subplots with plotly.express plots. We'll use this code for importing the library to project. from plotly.subplots import ...
Read more >Creating Various Plot Types and Subplots with Plotly
We will look at bar charts, histograms, scatter/bubble charts, and box plots. As we did in the my previous article on this topic,...
Read more >Supplementary material
Figure S1: The spike sorting algorithm at work. Upper subplot: 60 sec of continuous, bandpass-filtered data and the threshold used for detection (red...
Read more >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
As a simple workaround, you can just do
fig.update_traces(xaxis="x1")
which rebinds all your traces to the x-axis you want the spikelines to join up with.Thanks it works! Just needed to set it to the xaxis which is at the bottom. Then the ticklabels remain visible.
fig.update_traces(xaxis="x4")