You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traces with data arrays with length=0 are considered as if they were visible:false. These visible:false traces skip the calc step, so they don't get their _extremes stashes filled and getAutorangeexits early. This means that even though axis autorange gets coerced to true, we end up plotting the dflt range:
Activity
etpinard commentedon Aug 19, 2019
related: #3487
etpinard commentedon Sep 6, 2019
Here's a bit more info on the topic.
Traces with data arrays with
length=0are considered as if they werevisible:false. Thesevisible:falsetraces skip the calc step, so they don't get their_extremesstashes filled andgetAutorangeexits early. This means that even though axisautorangegets coerced totrue, we end up plotting the dflt range:plotly.js/src/plots/cartesian/set_convert.js
Lines 394 to 396 in 5f25eaf
plotly.js/src/plots/cartesian/constants.js
Lines 59 to 61 in 5f25eaf
So, I'm thinking we could easily add something like:
to
ax.cleanRangeso that the range dflt would be[0, 6]for x-axes and[0, 4]for y-axes whenrangemodeis set to'tozero'or'nonnegative'.That said, maybe instead we implement #400 and have users solve this problem by setting
xaxis.rangeoryaxis.rangeto[0].alexcjohnson commentedon Sep 6, 2019
sounds right to me. this is somewhat independent of #400 for eg. entirely negative axes with
tozeroor reversed ranges.fix #4137 - adapt default axis ranges to *rangemode*'