Skip to content

[BUG]: last period label sometimes not drawn when using negative ticklabelindex #7875

Description

@my-tien

Here is an example of the last ticklabel not being drawn. The figure's ticklabelindex is set to -1:

Plotly 3.6.0 (missing last label)
Image

Plotly 3.5.1 (all labels visible)
Image

This is a regression from #7735. In version 3.5.1 ticklabelindex was ignored because no minor ticks were drawn. In version 3.6.0 ticklabelindex is not ignored and so for this figure, the label is expected to be drawn to the left of each major tick (ticklabelindex -1). However, there is no tick to the right of the last period and so that period is not labeled.

Before ticklabelindex, period labels were only ever drawn to the right of a major tick. There is logic in plotly to add a helper tick before the first period, making sure it will be labeled. For negative ticklabelindex, the same logic is required for the period at the end of the axis range.

Codepen: https://codepen.io/toffi-fee/pen/MYJEWLY

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions