Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

histogram with barlabels #2238

Closed
lucanics opened this issue Mar 2, 2020 · 3 comments
Closed

histogram with barlabels #2238

lucanics opened this issue Mar 2, 2020 · 3 comments

Comments

@lucanics
Copy link

lucanics commented Mar 2, 2020

Hi,

For plotly.express, I cannot find a way to add barlabels to a histogram. None of the examples on this page - https://plot.ly/python/histograms/ - provide barlabels either. Here is one example:

import plotly.express as px
df = px.data.tips()
fig = px.histogram(df, x="total_bill")
fig.show()

image

It works fine with barcharts, tough:
image

Is there a way to add barlables to histograms?

@lucanics lucanics changed the title histogram with barlables histogram with barlabels Mar 2, 2020
@emmanuelle
Copy link
Contributor

Hum yes this is unfortunate... Indeed at the moment the histogram trace can only have hover trace. You can compute the histogram first using pandas or np.histogram and display the counts using a bar chart, @SylwiaOliwia2 is currently writing a doc example for this #2242.

@lucanics
Copy link
Author

lucanics commented Mar 5, 2020

I was thinking of the same workaround but thought there must be a simpler solution using update_traces that I was missing. Nevertheless, good to know someone is working on a doc example for this. Let me know if I can help somehow.

@gvwilson
Copy link
Contributor

Hi - we are currently trying to tidy up Plotly's public repositories to help us focus our efforts on things that will help users most. Since this issue has been sitting for several years, I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our backlog. Thanks for your help - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants