Legend shows arrow from annotate #8236#13034
Legend shows arrow from annotate #8236#13034Wojciech-Lange wants to merge 29 commits intomatplotlib:mainfrom
Conversation
dstansby
left a comment
There was a problem hiding this comment.
👍 Thanks for submitting this PR! Overall it looks good, I have added a couple of comments for code style changes. There are also a couple of test failures that need fixing - let us know if you need any more help with that.
|
|
||
| HandlerBase.__init__(self, **kwargs) | ||
|
|
||
| def create_artists( |
There was a problem hiding this comment.
Could the call aruguments be on multiple lines, but with a maximum line length of 79 characters? (if that makes sense; like
def func(arg1, arg2, arg3, arg4,
arg5)| handler = HandlerFancyArrowPatch() | ||
| handle = orig_handle.arrow_patch | ||
|
|
||
| return handler.create_artists( |
There was a problem hiding this comment.
Same as above regarding the function arguments here.
| from matplotlib.lines import Line2D | ||
| from matplotlib.patches import Patch, Rectangle, Shadow, FancyBboxPatch | ||
| from matplotlib.patches import (Patch, Rectangle, Shadow, FancyBboxPatch, | ||
| FancyArrowPatch) |
There was a problem hiding this comment.
Please align inside of the opening parenthesis.
| for axx in ax.parasites: | ||
| handles_original += (axx.lines + axx.patches + | ||
| axx.collections + axx.containers) | ||
| axx.collections + axx.containers+ax.texts) |
|
@haloxxx this looks quite close, but it'd help if you addressed the comments above. |
Refering to community suggestions
After these few months my request doesn't pass through checks. I've tried to apply all the suggestions, but I'm not sure if I can handle this by myself. |
|
You have a syntax error. Presumably that is straightforward to fix. Did you try running your example script before pushing the new commits? 😉 |
|
You may also need to rebase this on current master to pick up the fixes / changes to the doc build. |
|
I'm going to close this in favour of #23160, which is an updated version of this PR. |
PR Summary
Answer for #8236 issue. Legend automatically handles an arrow from annotate. In fact the code is a limited variant of #10688 . FancyArrowPatch and HandlerAnnotation added. There might be some relicts left from the wider solution (#10688).
Example code:
PR Checklist