Skip to content

Patch.update_from does not preserve the facecolor when alpha is set.  #842

@leejjoon

Description

@leejjoon

Here is an example.

 from matplotlib.patches import Patch

 pa1 = Patch(alpha=None, fc='none', ec='b')
 pb1 = Patch(alpha=1, fc='none', ec='b')

 pa2 = Patch()
 pb2 = Patch()

 pa2.update_from(pa1)
 pb2.update_from(pb1)

 assert pa1.get_fc() == pa2.get_fc()
 assert pb1.get_fc() == pb2.get_fc()

And the second assertion fails.
fc="none" sets facecolor to (0,0,0,0) but when update_from is called,
somehow its alpha value is overridden to 1 (because of alpha=1).
This seems to be a bug but others may think differently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions