You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I wanted to display vertical dash line on all subplots regardless of which graph you are focusing. I googled and found figure.update_traces(xaxis="x3") will make this work, but it destroyed hline. Notice that red dash line is disappeared on the second picture.
For bandaid, I can do figure.update_traces(xaxis="x1") instead, but it will destroy custom objects on second/third subplot. So this is not a fundamental resolution.
Personally I think showing horizontal or vertical dash line to indicate which x or y are you hovering is important. However, with current status you can potentially destroy custom plot objects like hline if you do that.
Thanks for reading this.
The text was updated successfully, but these errors were encountered:
McDic
changed the title
fig.update_traces(xaxis=..) will destroy hline and vline objects on subplotsfig.update_traces(xaxis=..) will destroy hline or vline objects on subplots
Nov 26, 2024
Summary
When the figure is created by
make_subplots
, updating traces' xaxis or yaxis will destroyhline
orvline
s from user's view.Details
The following picture represents my figure created with subplots of 3 rows and 1 column. It has horizontal line added by
figure.add_hline(y=0.0, ...)
.However, I wanted to display vertical dash line on all subplots regardless of which graph you are focusing. I googled and found
figure.update_traces(xaxis="x3")
will make this work, but it destroyedhline
. Notice that red dash line is disappeared on the second picture.Note that there is only 1 line of difference from above two codes.
For full codes, you can refer my repository's code.
For bandaid, I can do
figure.update_traces(xaxis="x1")
instead, but it will destroy custom objects on second/third subplot. So this is not a fundamental resolution.Personally I think showing horizontal or vertical dash line to indicate which x or y are you hovering is important. However, with current status you can potentially destroy custom plot objects like
hline
if you do that.Thanks for reading this.
The text was updated successfully, but these errors were encountered: