Skip to content

Boxplots render as lines for datetime x-axis and multiple y-axes #3516

@lemurey

Description

@lemurey

When using a datetime x axis and two y-axes single boxplots appear as vertical lines:
two axes
This also happens with a single y-axis and multiple plot types:
single axis
If you add a second boxplot on the same y-axis both render properly:
multiple box plots
Code example for case 1:
https://codepen.io/anon/pen/zeEKEo

Activity

etpinard

etpinard commented on Feb 6, 2019

@etpinard
Contributor

Thanks for the report.

Very related to #3508

alexcjohnson

alexcjohnson commented on Feb 6, 2019

@alexcjohnson
Collaborator

FWIW what's happening is we don't know what width to give the boxes, because there are no other boxes on the same subplot to to give a distance to the next box, so they get a width of 1 - which for dates means 1 millisecond, hence on a scale of days it looks like zero width. You can fix this with an explicit width attribute (added recently in #3234, as @etpinard mentioned in #3508)

@etpinard are you thinking we can have boxes on overlaying subplots consider each other in width calculations? That seems like it would work for the first example, with boxes on each axis, and offhand I don't see any cases you'd want the existing behavior. Would you want to do this for stacked subplots as well? ie consider all boxes on the same position axis? That would be useful if @lemurey's
first example were converted to stacked subplots, though I can also imagine cases it might constitute a breaking change...

The second example (box + scatter) I don't really see any solution for except explicit width; there's really nothing to guide us in scaling the box.

lemurey

lemurey commented on Feb 6, 2019

@lemurey
Author

@alexcjohnson Thanks for the note on width, I hadn't seen that, that will easily solve my immediate issue.

gvwilson

gvwilson commented on Jun 11, 2024

@gvwilson
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @gvwilson@alexcjohnson@etpinard@lemurey

        Issue actions

          Boxplots render as lines for datetime x-axis and multiple y-axes · Issue #3516 · plotly/plotly.js