Skip to content

Smarter defaults for axis anchors #1200

Description

@alexcjohnson

We could be smarter about axis anchors for subplots, basing their default values off the traces we have.

In a new mock I made for date axes, there are 7 stacked subplots, each with one trace and its own x and y axes. All the traces have:
xaxis: 'x<n>', yaxis: 'y<n>'
and all the x axes have layout obects:
xaxis<n>: {anchor: 'y<n>'}

With smarter defaults, I would not have needed to include these x axis objects at all since 'x<n>' is only ever used with 'y<n>' in the data. In fact, in principle my y axes should also be anchored to the corresponding x axes... I didn't do that, and it didn't matter here because all the x axes have domain [0, 1], but if I were to change some of these domains, then I would be in for some confusion as the y axes wouldn't move as I would expect.

This would not be backward compatible, so I guess should be included in v2.0 if we do it, but I can't really think of a situation where people would be depending on the existing defaults.

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions