Skip to content

inside ticks with dual y-axes #5402

Closed
Closed

Description

@nicolaskruchten

In this pen https://codepen.io/nicolaskruchten/pen/QWKJamw the range on the left side should make room for the y2 tick labels. I'm not sure what the general principle is here... is it because y2 is anchored to x or just because there exists a trace on x, y2? @alexcjohnson if you have any insight into a general rule here, I'd appreciate any thoughts.

Activity

  1. alexcjohnson commented on Jan 14, 2021

    @alexcjohnson
    Collaborator

    Nice find. Certainly this depends on y2 being anchored to either x or another axis that overlays x. I don't think it matters what traces exist, we want everything in that subplot to avoid overlapping these labels.

    So I guess the rule is: a set of y axis inside tick labels should contribute to the autorange for the x axis it's anchored to and any other x axis grouped with it via overlaying.

    For example, suppose we have x, x2, and x3, the latter two both overlaying: 'x', and we have y2 anchored to x2. We need to figure out that all three of these x axes should leave space for the y2 labels in their autorange, even though that requires following the overlaying chain downstream from x2 to x and then back upstream from x to x3.

  2. nicolaskruchten commented on Mar 16, 2021

    @nicolaskruchten
    ContributorAuthor

    For future reference, there are cases with more than two Y axes that are possible, for example a two-subplot case, vertically offset, where the X axis range is shared, so you have y1/y2 anchored to x1 and y3/y4 anchored to x2 and x2 overlaying x1.

    Presumably we want this to work with matches also, right?

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

      Issue actions