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]: Updating the facecolors of a collection before its first draw has no effect #24479

Open
@anntzer

Description

@anntzer

Bug summary

Create e.g. a pathcollection (a scatter plot) not mapping any array, but with directly set colors; then update one of the facecolors before the first draw of the collection. This change has no effect and gets cancelled.

Code for reproduction

importmatplotlib.pyplotaspltsc1=plt.scatter([0,1,2], [0,1,2],c=["r","g","b"])sc2=plt.scatter([0,1,2], [2,3,4],c=["r","g","b"])# Update sc1 before the first draw.sc1.get_facecolors()[2]= (0,0,0,1)# i.e. black.plt.gcf().canvas.draw()# Update sc2 after the first draw.sc2.get_facecolors()[2]= (0,0,0,1)# i.e. blackplt.show()

Actual outcome

test
Note that the third point of sc1 is incorrectly blue, whereas the third point of sc2 is correctly black.

Expected outcome

Both third points are black.

Additional information

First noted by@chahak13 in#24474 (comment).
I haven't done a full bisect but did check that this broke at some point between 3.3.4 and 3.4.0, and I suspect#18480 introduced the issue (in the changes related to update_scalarmappable); attn@efiring.

Operating system

fedora37

Matplotlib Version

3.7.0.dev538+g9b4985e185

Matplotlib Backend

qtagg

Python version

3.10

Jupyter version

ENOSUCHLIB

Installation

git checkout

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