Skip to content

Implement LegendHandler for FeatureArtist #334

@pelson

Description

@pelson

Implement a Handler for the feature artist which can deal with the fact that FeatureArtist does not implement the full artist api. Also, as a step up from what mpl can currently do, ensure that if a patch has no facecolor, a line handler is used instead (i.e. you get a line in the legend, rather than a box).

Code to register the handler:

from matplotlib.legend import Legend
from matplotlib.legend_handler import HandlerPatch

# Register the FeatureArtist for legend drawing.
Legend.update_default_handler_map({FeatureArtist: HandlerPatch()})

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