Skip to content

Streamline xanchor and yanchor names for center/middle #5326

@mmarras

Description

@mmarras

The 'xanchor' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'left', 'center', 'right']

The 'yanchor' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'top', 'middle', 'bottom']

This is for plotly 6.3.0 trying to use fig.add_annotations() but it likely applies everywhere where xanchor and yanchor are used.

It does make sense that for the extremes of the bounding box left right top bottom, the names are different, but why is 'center' used for x direction and 'middle' for y direction? This distinction seems artifical to me and I wonder why this was chosen?

I propose to streamline the naming conventions, but now for backwards compatibility to at least accept both center/middle for x/yanchor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions