Skip to content

[MNT]: deprecate auto hatch fallback to patch.edgecolor when edgecolor='None' #29380

Open
@story645

Description

@story645

Summary

Since #28104 now separates out hatchcolor, users should not be allowed to specifically ask to fallback to edgecolor and also explicitly set that edgecolor to none because silently falling back on edgecolor="None" introduces the problem that:

  1. because of eager color resolution and frequently setting "none" by knocking out the alpha, the way to check for none is checking the alpha, which leads to fallback being dependent on the interplay between alpha and edgecolor:
    Figure_1

  2. fallback to edgecolor rcParams doesn't check if the rcParam is also none so could sink the problem a layer deeper

Proposed fix

Deprecate this fallback behavior and raise a warning on

Rectangle( (0,0), .5, .5, hatchcolor='edge', edgecolor='None')

The alternatives are:

  • set a hatchcolor
  • don't set edgecolor at all, .i.e. Rectangle( (0,0), .5, .5, hatchcolor='edge') falls back to the rcParam in get_edgecolor

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