plotly / plotly.js

Open-source JavaScript charting library behind Plotly and Dash
https://plotly.com/javascript/
MIT License
16.93k stars 1.85k forks source link

render histograms on log axes with bin edge at 0 #6200

Open nicolaskruchten opened 2 years ago

nicolaskruchten commented 2 years ago

In this codepen, the first plot shows a basic histogram, although note that the leftmost bin edge is 0. The second plot just changes the x-axis type to log, which causes all the bars to disappear. The third plot shows that histograms on log axes can and do work, when there is not a bin edge at 0.

It would be nice if histograms reliably rendered on log axes, even with linearly computed bins like we have right now, because then folks could compute their own log bins and display plots. In some future iteration we could support automatic log bins, but let's just fix this one bug first? Would be good to make sure it's fixed for histogram2d etc as well if possible

FlorinAndrei commented 1 year ago

Any progress?

px.histogram(log_x=True) fails because of this bug if some x values are zero.