FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Doc]: Improve legend loc and bbox_to_anchor documentation · Issue #26620 · matplotlib/matplotlib · GitHub

Repository navigation

[Doc]: Improve legend loc and bbox_to_anchor documentation #26620

Closed

Description

Documentation Link

https://matplotlib.org/devdocs/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend

Problem

Inspired by #26612

  1. Legends: Replace confusing terminology like bbox_to_anchor etc, and make the legend positioning simpler

Suggested improvement

Parameter loc

  • Explicitly state that the locations are positions within a given box (configurable via bbox_to_anchor, default: Axes box)

  • Replace

    The strings 'upper left', 'upper right', 'lower left', 'lower right' place the legend at the corresponding corner of the axes.
    The strings 'upper center', 'lower center', 'center left', 'center right' place the legend at the center of the corresponding edge of the axes.
    The string 'center' places the legend at the center of the axes.

    By Add a visual similar to the cheat sheet

    but with the string names in the respective positions.

Parameter bbox_to_anchor

Activity

  1. story645 commented on Aug 29, 2023

    Member

    xref #10079

  2. amanparganiha commented on Mar 29, 2026

    Contributor

    I'm working on a fix for this. Will open a PR shortly.

  3. added this to the v3.11.0 milestone on Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL