Skip to content

axisDraw: Hitting ax.domain[1] < ax.domain[0] #6499

@zeehio

Description

@zeehio

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'.

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)).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions