8000 [Bug]: triplot duplicates label legend · Issue #22965 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
[Bug]: triplot duplicates label legend  #22965
Closed
@maweigert

Description

@maweigert

Bug summary

Hi,

When using triplot with a label the resulting legend contains two duplicated entries (even though the markers is None):

plt.triplot([0,2,1],[0,0,1],[[0,1,2]], label='Label'); 
plt.legend()

Screenshot 2022-05-03 at 12 17 10

I think expected behavior would be either

  1. Remove the second legend entry if no markers are given, or
  2. Remove the second legend entry altogether, e.g. by using kw_markers.pop('label',None) around here

Code for reproduction

see above

Actual outcome

see above

Expected outcome

see above

Additional information

No response

Operating system

MacOS

Matplotlib Version

3.6.0.dev2140+g2aa71eb355.d20220503

Matplotlib Backend

QtAgg

Python version

No response

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: default changesDifficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!topic: legend

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0