Dear Plotly’s community,
I am working with Plotly.py in a reserach project in which I need to analyze a set of data with Pandas. Everything works fine, Plotly is really awesome and I felt in love when I began to use it. However I am having a little problem for which I don’t found an answer.
I need to set the option “Compare data on hover” by default. I have seen some questions here, but no one seems useful for me. Although it may be I didn’t the find the correct one that answer my question
The way in which I am creating the figure is:
fig = go.Figure()
fig.add_trace(
go.Bar(...)
)
fig.add_trace(
go.Bar(...)
)
fig
I tried to set hovermode="closes"
using update_layout
with fig
. However it doesn’t set the option I need as default. I read the Python’s Figure Reference page but I don’t find something to set it by default.
Could it be set by default?
Thanks in advance for your attention!
Regards
P.S. (1) I have data in each go.Bar
but I prefer to summarize the code using ...
.
P.S. (2) Maybe an important thing to note is that I am working with Plotly.py inside a Jupyter Notebook on Google Colaboratory.