Skip to content

Plotly 5.23.0, Hover on Subplots Only Work on one subplot #4701

Closed
@luweiming

Description

@luweiming

Hi All,

I'm using the latest Plotly 5.23.0

I've been trying days to make the Hover on Subplots work, and it turns out it didnt even work from the example/code listed on the plotly site https://plotly.com/python/hover-text-and-formatting/.

Anyone also encounter with the same issue? How to fix this? Thanks.

I'm using Windows 11, VScode, Jupyter Notebook or Python environment, none worked.

import plotly.graph_objects as go
import pandas as pd
from plotly import data

df = data.stocks()

layout = dict(
hoversubplots="axis",
title="Stock Price Changes",
hovermode="x",
grid=dict(rows=3, columns=1),
)

data = [
go.Scatter(x=df["date"], y=df["AAPL"], xaxis="x", yaxis="y", name="Apple"),
go.Scatter(x=df["date"], y=df["GOOG"], xaxis="x", yaxis="y2", name="Google"),
go.Scatter(x=df["date"], y=df["AMZN"], xaxis="x", yaxis="y3", name="Amazon"),
]

fig = go.Figure(data=data, layout=layout)

fig.show()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions