plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

change format of number in hover Text

Open Jacques2101 opened this issue 5 years ago • 2 comments

Hi, my question Is simple but I cannot find an answer. I run :

import plotly.express as px
df = px.data.tips()
fig = px.box(df, x="time", y="total_bill")
fig.update_layout(
    hoverlabel=dict(
        bgcolor="white", 
        font_size=12, 
    )
)
fig.show()

It works fine but when I put my cursor on the graph, I would like to change the format (ie 1 decimal) on the numbers.

How can I do ? Thanks Capture d’écran 2020-05-25 à 20 30 07

Jacques2101 avatar May 25 '20 18:05 Jacques2101

Also would like to be able to easily customize which of these calculated data points show up. To show only q1, median, q3 for example, I think we'd have to duplicate the calculations done by the px.box() to create custom_data and then create a new hover template with the customdata[] elements.

builder173 avatar Nov 19 '23 01:11 builder173

I don't think it's currently possible to customize the hover template of a box plot.
@archmoj Can you please correct me if I'm wrong.

Coding-with-Adam avatar Nov 21 '23 18:11 Coding-with-Adam

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Alternatively, if it's a request for tech support, please post in our community forum. Thank you - @gvwilson

gvwilson avatar Jul 08 '24 12:07 gvwilson