-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add_hline() breaks when axis is shared #3209
Comments
Right, so Do you get the behaviour you want if you add the rects/lines before updating the traces? |
No. Unfortunately the same behavior occurs regardless of when the shapes are drawn. If this is the way it is designed to behave, the Is there any other way you'd think I might be able to get away with having vrects and a spikeline that goes across all subplots? Thanks for the suggestion though! |
Try something like the following, to apply the same transformations to your lines and rects as you are applying to your traces: fig.update_shapes(selector=dict(type="line"), xref="x2 domain")
fig.update_shapes(selector=dict(type="rect"), xref="x2") |
Worked like a charm! Thank you so much; looks sick now |
@nicolaskruchten, Do you have any insights into why the x-axis is bugging out when I uncomment these lines? 🤔 Reproducible Code
Chart Outputs
|
Hi @AlanCPSC |
Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson |
I'm currently using
fig.update_xaxes(spikemode='across+marker')
withfig.update_traces(xaxis='x2')
, as suggested here, to draw spike a line across subplots. It was working great until I added some horizontal lines to my chart.add_hline()
andupdate_traces(axis='x2')
update_traces(axis='x2')
withoutadd_hline()
add_hline()
withoutupdate_traces(axis='x2')
Repro:
Is this a bug or am I not supposed to share axis here?
The text was updated successfully, but these errors were encountered: