Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement LegendHandler for FeatureArtist #334

Open
pelson opened this issue Sep 6, 2013 · 1 comment · May be fixed by #1500
Open

Implement LegendHandler for FeatureArtist #334

pelson opened this issue Sep 6, 2013 · 1 comment · May be fixed by #1500

Comments

@pelson
Copy link
Member

pelson commented Sep 6, 2013

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()})
@pelson
Copy link
Member Author

pelson commented Sep 20, 2013

This encouraged me to improve the mpl documentation: matplotlib/matplotlib#2442

It is now a case of simply implementing a handler as documented in the legend guide 😄

@pelson pelson removed this from the 0.12 milestone Jun 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant