In the follwoing small Dash app:
df = pd.read_csv(...)
fig = px.line(x=.., y=.., color=..., template='presentation')
app = dash.Dash(__name__)
app.layout = htmlDiv([dcc.Graph(figure=fig)])
I still see hover popups on all traces, although I explicitly disable them via
Do I have to use a call to another
fig.update_.. method? I would like to keep the figure instantiation via
fig = px.line(....
Thanks for any pointers.
Ah, sorry this is confusing… Plotly Express uses the new
hovertemplate mechanism for its hovers, so you’ll also need to set
hoverinfo='skip' in your
Thanks @nicolaskruchten. That works well.
I have a related question. In Plotly Express, I would like ONLY the text from hover_name to appear on my hover popups. I’ve tried various combinations with no success. How can I suppress the default hoverinfo and only show the bold text from hover_name?
The following still shows hoverinfo for color, x and y:
fig = px.scatter(boxplot_data,
x="Current Applet Installs",
y="Potential Applet Installs",
color_discrete_sequence=["dodgerblue", "limegreen", "orange", "red"],
You can use string interpolation combined with the
hovertemplate attribute in order to get the effect you are looking for.
import plotly.express as px
hover_name = "hover_name"
fig = px.scatter(x=[1, 2, 3, 4, 5],
y=[1, 2, 3, 4, 5],