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
This one is a little weird. Under hovermode: 'closest' the hover labels look fine and then when returning to hovermode: 'x' the comparison hover labels look ok.
I just thought I'd add a comment to this as I was about to file a separate bug report, then realised that this may be the same issue. In short, my issue was that I was getting the wrong hover label, and the fix was to set hovermode="closest". As a naive user it just looked like a bug to me so I would suggest that maybe hovermode="closest" should be the default setting - it seems to me the intuitive behaviour.
Here's a code snippet that demonstrates what I thought at first was a "bug". I cannot get a tooltip for the B point in this dataset with the default hover mode, because the C tooltip comes up instead:
import pandas as pd
import io
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
import plotly.graph_objs as go
init_notebook_mode()
df_str = """\
x y label
1 2 A
2 1 B
2 3 C"""
with io.StringIO(df_str) as f:
df = pd.read_table(f, sep=" ")
scatter = go.Scatter(x = df['x'], y = df['y'],
mode = 'markers',
marker = {'size':10}
text = df['label'])
layout = go.Layout(
xaxis={'range': [0, 3]},
yaxis={'range': [0, 4]},
)
fig = go.Figure(data=[scatter], layout=layout)
plot(fig)
Activity
etpinard commentedon Mar 29, 2017
Thanks for report.
This one is a little weird. Under
hovermode: 'closest'
the hover labels look fine and then when returning tohovermode: 'x'
the comparison hover labels look ok.For devs, http://codepen.io/etpinard/pen/RpqPvP is a little easier to digest.
[-]Value displayed in the hover box is false[/-][+]Value displayed in the hover box is incorrect[/+][-]Value displayed in the hover box is incorrect[/-][+]Value displayed in the hover label is incorrect[/+]claresloggett commentedon Aug 18, 2017
I just thought I'd add a comment to this as I was about to file a separate bug report, then realised that this may be the same issue. In short, my issue was that I was getting the wrong hover label, and the fix was to set
hovermode="closest"
. As a naive user it just looked like a bug to me so I would suggest that maybehovermode="closest"
should be the default setting - it seems to me the intuitive behaviour.Here's a code snippet that demonstrates what I thought at first was a "bug". I cannot get a tooltip for the
B
point in this dataset with the default hover mode, because theC
tooltip comes up instead:alexcjohnson commentedon Mar 7, 2018
This seems to have been fixed some time ago, as of v1.30.0 - perhaps #1932.