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

Log axes aren't supported in `histogram2d` or `histogram2dcontour`

Open chriddyp opened this issue 9 years ago • 19 comments

as reported in the community forum: https://community.plot.ly/t/2d-histogram-with-log-axes-supported/4711

example: https://plot.ly/~chris/18409/

chriddyp avatar Jul 03 '17 21:07 chriddyp

https://codepen.io/etpinard/pen/gRzGXg

Do 1D log-axes histogram even work? Is that even a thing?

etpinard avatar Jul 03 '17 23:07 etpinard

Here's the perspective of the use who reported it: image

chriddyp avatar Jul 04 '17 02:07 chriddyp

This one has some interesting theoretical implications: It's not just a matter of displaying the histogram on a log axis (showing a heatmap or bar trace on a log axis works fine). You also need to space the bins logarithmically, and if there's normalization it amounts to something like "counts per decade" instead of whatever units are on the axis.

Also this would give us more motivation to include the bounds of the bin in hover labels, not just the center - see #69. Or, even better, the bounds of the data in the bin... for example if your bin is 1.5 - 3.5 but your data is all integers, it should say 2 - 3.

alexcjohnson avatar Jul 13 '17 23:07 alexcjohnson

https://codepen.io/etpinard/pen/gRzGXg

Do 1D log-axes histogram even work? Is that even a thing?

totally a thing, and would love to use plotly for this. Is this in the works...?

ericbdaniels avatar Oct 17 '18 02:10 ericbdaniels

totally a thing,

Could you share an example/screenshot from another library to help us out?

etpinard avatar Oct 23 '18 14:10 etpinard

currently using numpy to set bins and plotly bar as work around image

log option in matplotlib sets y axis to log scale rather than x. No great option in python that I'm aware of, other than setting bins manually.

Log scale x axis is desirable in the case of highly skewed distribution. In my own experience is this is common with geoscience data where GSLIB Histplt is often used

ericbdaniels avatar Oct 24 '18 16:10 ericbdaniels

From my point of view, the 1D histogram should show like a normal histogram of the logarithm of the data, and actually my current workaround is to do that and then manually set the non logarithm values for the ticks. The only problem is that this only works well with static bins. Example:

screen shot 2019-01-30 at 9 54 23 am

vlizanae avatar Jan 30 '19 13:01 vlizanae

I, too, would like to use log axes in a histogram2d. Currently, it is just odd. For instance, using the "2D Histogram of a Bivariate Normal Distribution with Plotly JS" example and just changing the yaxis to type: 'log', you get a strange row of data: https://codepen.io/manthey/pen/VNjZMy If you manually change the range of the y axis, it looks like all of the data is offset, but otherwise somehow binned: https://codepen.io/manthey/pen/EJyYLW

manthey avatar Apr 05 '19 21:04 manthey

+1 for this feature

priesgo avatar May 11 '19 08:05 priesgo

having the same issue here, is there a workaround?

DanielTea avatar Jun 03 '20 21:06 DanielTea

+1

rusiano avatar Jun 12 '20 07:06 rusiano

+1

svili avatar Jun 16 '20 08:06 svili

+1

plasmapotential avatar Aug 09 '20 23:08 plasmapotential

This still seems like a good idea! FYI to folks coming across this issue: If your organization needs this feature, then reach out to our services team to fund the development: https://plotly.com/products/consulting-and-oem. This is how many new features are supported & developed 🍻

chriddyp avatar Aug 25 '20 00:08 chriddyp

This issue has been tagged with NEEDS SPON$OR

A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort.

Sponsorship range: $10k-$15k

What Sponsorship includes:

  • Completion of this feature to the Sponsor's satisfaction, in a manner coherent with the rest of the Plotly.js library and API
  • Tests for this feature
  • Long-term support (continued support of this feature in the latest version of Plotly.js)
  • Documentation at plotly.com/javascript
  • Possibility of integrating this feature with Plotly Graphing Libraries (Python, R, F#, Julia, MATLAB, etc)
  • Possibility of integrating this feature with Dash
  • Feature announcement on community.plotly.com with shout out to Sponsor (or can remain anonymous)
  • Gratification of advancing the world's most downloaded, interactive scientific graphing libraries (>50M downloads across supported languages)

Please include the link to this issue when contacting us to discuss.

jackparmer avatar Sep 10 '20 19:09 jackparmer

Bumping... no reason this should still be open. I can't do log_z=True still...

danthegoodman1 avatar Aug 27 '23 15:08 danthegoodman1

@gvwilson I see some recent activity on this. Does it mean it will be soon available ? Would be an absolute game changer for my case. Many thanks

paulduf avatar Aug 02 '24 15:08 paulduf

hi @paulduf - I started as the Engineering Manager for the Libraries team 14 weeks ago and am still sorting through backlog. No idea when/if someone will be able to get to this one, but I'll post updates here. cheers - @gvwilson

gvwilson avatar Aug 02 '24 15:08 gvwilson

+1

datavistics avatar Jan 24 '25 04:01 datavistics