Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Feature Proposal
allow artists and proxy objects to define their own legend handler
background
Currently one has to define a handler map with an object if you want to get your own proxy legend entry. It needs to provide an object with only the methodlegend_artist
. It would be a lot easier if if any proxy object used in the legend - or any artist - defining their ownlegend_artist
method, that is being used. At the very least if there is no handler in the handler list for this object, but maybe even overwriting the handler map. For the former, in legend.py one would only need to add in the routine
defget_legend_handler(legend_handler_map,orig_handle):
The extra lines:
ifhasattr(orig_handle,'legend_artist'):returnorig_handle
before the
returnNone
if added at the beginning of the routine, it would overwrite the map. I assume not even the former is very likely to affect much existing code.