Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: Marker missing from legend for contour plots #23303

Open
@anton-seaice

Description

@anton-seaice

Bug summary

When a contour plot is made and a legend is added, the marker for the contour plot is not shown.

Code for reproduction

importmatplotlib.pyplotaspltimportnumpyasnpdata=np.random.randint(100,size=(100,100))plt.figure()cs=plt.contour(data,levels=[50])cs.collections[0].set_label('label')plt.legend()plt.show()

Actual outcome

download

Expected outcome

In the area for the legend, next to the label for the legend, there should a solid purple line. Solid purple line would represent the lines in the main plot for that contour.

download

Additional information

No response

Operating system

Rocky Linux release 8.5 (Green Obsidian)

Matplotlib Version

3.5.2

Matplotlib Backend

module://matplotlib_inline.backend_inline

Python version

Python 3.9.13

Jupyter version

3.4.3

Installation

conda

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp