✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

Display of trace values of all sub plots at the bottom of figure in Plotly

I am working on data visualization using plotly. I need to plot 3 variables in 3 separate plots and whever cursor is placed, corresponding values of three variables need to be displayed at the bottom of the figure. below is the code for generating subplots.

import plotly
import plotly.graph_objs as go
import pandas as pd
import plotly.graph_objects as go
from plotly.subplots import make_subplots

import pandas as pd
import re

df = pd.read_csv("finance-charts-apple.csv")

fig = make_subplots(
    rows=3, cols=1,
    shared_xaxes=True,
    vertical_spacing=0.0,
    horizontal_spacing = 0.0,
    specs=[[{"type": "scatter"}],
           [{"type": "scatter"}],
           [{"type": "scatter"}]])

fig.add_trace(
    go.Scattergl(
        x=df.Date,
        y=df['AAPL.High'],
        mode="lines",
        name="AAPL_high"
    ),
    row=1, col=1
)    

fig.add_trace(
    go.Scattergl(
        x=df.Date,
        y=df['AAPL.Low'],
        mode="lines",
        name="AAPL_low"
    ),
    row=2, col=1
)    

fig.add_trace(
    go.Scattergl(
        x=df.Date,
        y=df['AAPL.Close'],
        mode="lines",
        name="AAPL_Close"
    ),
    row=3, col=1
) 

fig.update_layout(
    height=800,
    showlegend=True,
    title_text="Apple market share",
    hovermode= 'x unified',
    hoverinfo= "x+y",
    spikedistance= -1,
    xaxis = dict(
            showspikes = True,
            spikemode = 'across + toaxis',
            spikesnap = 'cursor',
            showline= True,
            showgrid = True,
            spikedash = 'solid'))

fig.update_xaxes(matches='x')
fig.update_traces(xaxis='x1')
fig.show()
plotly.offline.plot(fig)

As per above code, I am able to plot 3 sub plots with vertical hover across all the sub plots. What I want to know is, is there any way to display all the 3 traces values for particular x value, at the bottom of the figure?

There’s no straightforward way to make this appear at the bottom, but our new “unified hoverlabel” will get you pretty close: https://plotly.com/python/hover-text-and-formatting/#unified-hovermode

thank you for reply. that behaviour is okay for me.
as mentioned in my isssue, i have already used ‘x unified’ in my code.
but i am having multiple subplots. when i place cursor on one pertical sub plot, only that subplot y axis value
is dispalyed. i want all subplots y values to be displayed at that instant.

Ah I see, sorry, I mostly looked at your screenshot and not at your code. There’s no way at the moment to trigger the hoverlabel behaviour across subplots, unfortunately.