Skip to content

single-ended y-axis range specification [0,null] is not respected when x.automargin is triggered. (2.27.0) #6762

Open
@RichardNeill

Description

@RichardNeill

Please take a look at this:
https://codepen.io/RichardNeill/pen/rNPVKKV
in plotly 2.27.0 or 2.26.2

  1. Note that the y-axis range is specified as [0,null]. This means y-min must be explicitly 0, while y-max should be automatic, according to the data.
  2. Observe that the point on Wed 25th,00:00, with a value of -68 is visible, DESPITE the fact that the y-axis should never go below zero.
  3. Also observe that the y-axis range goes from -100 to 350, rather than 0 to 350 as expected.

This bug was tricky to reproduce. For it to happen:

  1. The y-axis range must be specified explicitly, single-sided e.g. [0,null]
    If the y-axis is automatic, the desired behaviour doesn't occur, while if the range is explicit at both ends: e.g. [0,300], the bug does not appear.

  2. Turning off x.automargin prevents the bug from manifesting.

  3. If the window width is too large (on my screen, this is at ~ 1920px), or there are too few data-points, this allows all the X-labels to fit horizontally. Since the layout engine does not move the labels to 45-deg or vertical, this doesn't trigger the x.automargin behaviour, which in turn prevents the y_axis[0] from getting borked.

I hope this is helpful. Thank you for your time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2considered for next cyclebugsomething brokensev-2serious problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions