-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Using plotly from R, I have a complex plot that creates a long legend (I'm having issues hiding it). Anyway, I guess spacing becomes so tight that I end up getting a scenario where ax.domain[1] < ax.domain[0] when titleHeight / gs.h is subtracted from ax.domain[1]. This ends up giving me pain with a negative ax._length that throws the error 'Something went wrong with axis scaling'.
plotly.js/src/components/colorbar/draw.js
Line 469 in 7427f14
| ax.domain[1] -= titleHeight / gs.h; |
A more robust alternative could be:
ax.domain[1] = Math.max(ax.domain[1] - titleHeight / gs.h, ax.domain[0]);
Or maybe we need ax.domain[0] be strictly less than ax.domain[1]. I have no idea
Apologies for not being able to provide a reproducible example. I will do my best, to provide it, but it's not easy due to all the layers (my plot, ggplot, plotly (R), plotly (javascript)).