-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
autorange should not display zero line for certain bars with positive base and negative value #4701
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
Comments
Something possibly went wrong in autorange when using |
It works well if we force plotly.js/src/plots/cartesian/autorange.js Line 335 in ebab12b
|
Not sure if we should have tag this as a bug. |
Definitely a bug - and we have logic that appears intended to address exactly this, but somehow isn't working. plotly.js/src/traces/bar/cross_trace_calc.js Line 521 in b8a452c
|
minimal demo in regards with the new title. |
Ah, nice sleuthing @archmoj! In fact, to dive into the details of I wonder if the correct |
@alexcjohnson I think we still want to display the zero line when the values are negative. |
@emmanuelle thanks very much for the report. In your codepen, would you mind set plotly.js version to 1.52.3 and not use the latest? |
Why? What makes that case different from its positive twin? |
I don't have strong opinion on that. Perhaps as a result of this bug, I always thought we wanted to display zerolines for bars with negative values. |
To my mind the primary purpose of |
For historical context, I think before we had a But yeah, when there are no bars with a |
My feeling is that we should behave symmetrically, and not arbitrarily try to include the zero line for either positive or negative bars. This has caused issues in the past actually, so I would consider the current behaviour a bug, unless it exists to support some specific use-case. |
See for example https://codepen.io/emmanuelle-plotly/pen/bGdOLmR?editable=true, the axis starts at 0 and therefore a large part of the domain is not used to represent data. For other sets of data the automatic range works well.
Triggered by plotly/plotly.py#2327
The text was updated successfully, but these errors were encountered: