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

explain that 'stack' barmode also works for px.bar

Open Ddedalus opened this issue 6 years ago • 4 comments

Hi, this is my first pull request, if I choose the wrong branch, please let me know :)

Just a small extension to the available options of px.bar to begin with.

Ddedalus avatar Dec 09 '19 10:12 Ddedalus

Thanks for this PR! I had initially left out "stack" because it's so easy to misunderstand what it does with respect to negative values... We probably should indeed add it but with a clear warning about how unintuitive the output can be.

nicolaskruchten avatar Dec 09 '19 14:12 nicolaskruchten

I've tried it out on a small example and added a brief note. If you think more explanation is needed there (or my understanding is wrong), please go ahead. It may be a good idea to put a longer description in go.Bar docs as well...

Out of curiosity, how would you create a stack plot where positive and negative values are stacked separately on the opposite sides of the x-axis?

Ddedalus avatar Dec 10 '19 17:12 Ddedalus

Thanks for updating the PR @Ddedalus ! @nicolaskruchten I think we can merge this one?

emmanuelle avatar Dec 11 '19 15:12 emmanuelle

Right, so to stack above and below zero the option is “relative”. The “stack” option is supported but needs a clear and scary warning like “this is almost never what you want to use and will often mislead viewers when negative values are involved” or something like that. We have to support it for backwards compatibility reasons but IMO it’s quite a dangerous option.

nicolaskruchten avatar Jan 25 '20 19:01 nicolaskruchten