You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tagged as new contributor friendly because it is self-contained, but medium difficulty as it involves understanding the legend machinery (which is powerful, but a bit under-documented).
It would be better if legend found the annotation arrow automatically. It would also be better if legend handled FancyArrowPatches better. They are all drawn as rectangles, which is the default for patches, but they should draw little arrows in the legend.
I'm new to this, so here are my thoughts on how to proceed:
create HandlerFancyArrowPatch in legend_handler.py that handles fancy arrow patches in general, drawing the appropriate arrow
create HandlerAnnotation that takes an Annotation object and calls HandlerFancyArrowPatch if the annotation has an arrow associated with it
Reacted by Héctor Otero Mediero, Maged Hennawy, ArminGitHub and Alexandre Vieira
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Activity
tacaswell commentedon Mar 8, 2017
Because they are not in the list of things the that are looked for to be added to the legend by default. Start from https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/axes/_axes.py#L546 and trace back.
You will probably also have to add a LegendHandler.
Exact work:
Axes.get_legend_handles_labels@jlecoeur want to take a crack at this?
tacaswell commentedon Mar 8, 2017
Tagged as new contributor friendly because it is self-contained, but medium difficulty as it involves understanding the legend machinery (which is powerful, but a bit under-documented).
bendichter commentedon Mar 11, 2017
@jlecoeur: You can achieve something close to what you are looking for with:
It would be better if legend found the annotation arrow automatically. It would also be better if legend handled FancyArrowPatches better. They are all drawn as rectangles, which is the default for patches, but they should draw little arrows in the legend.
I'm new to this, so here are my thoughts on how to proceed:
create HandlerFancyArrowPatch in legend_handler.py that handles fancy arrow patches in general, drawing the appropriate arrow
create HandlerAnnotation that takes an Annotation object and calls HandlerFancyArrowPatch if the annotation has an arrow associated with it
jlecoeur commentedon Mar 12, 2017
Thanks @bendichter @tacaswell, I will try to implement it and I'll let you know!
matplotlib#8236
github-actions commentedon Apr 8, 2023
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!