Take text objects into account in legend autopositioning. · Issue #7869 · matplotlib/matplotlib · GitHub
Skip to content

Take text objects into account in legend autopositioning. #7869

Description

@anntzer

Legend autopositioning currently does not take text objects into account as can be checked by running

plt.plot([0, 1], label="foo"); plt.text(.05, .95, "a"); plt.legend()

This is because text objects are not included in _auto_legend_data (which only serves that purpose, AFAICT).

Adding them should be easy, but extra points if the autoplacement algorithm penalizes overlapping with text more than overlapping with other artists (given that it's probably indeed worse in general).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions