Skip to content

[Bug] Legend 'xanchor' setting plot's x position rather than legend's #5983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wunderBarr7 opened this issue Oct 15, 2021 · 1 comment
Closed

Comments

@wunderBarr7
Copy link

wunderBarr7 commented Oct 15, 2021

When using horizontal legend orientation, using the 'xanchor' property sets the plot's x position rather than the legend's x position.

Link to Example Code

@wunderBarr7 wunderBarr7 changed the title Legend 'xanchor' setting plot's x position rather than legend's [Bug] Legend 'xanchor' setting plot's x position rather than legend's Oct 15, 2021
@OpportunityLiu
Copy link
Contributor

You'd set x: 0.5 with xanchor: 'center' to center the legend.

legend: {
    orientation: 'h',
    xanchor: 'center',
    x: 0.5,
  }

The default value of x is 0, with xanchor: 'center', the legend will be aligned with 0 at its center.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants