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
As discussed in this SO question and this mailing list thread, PatchCollection cannot handle FancyArrowPatch patches, as the paths for FancyArrowPatch can't be evaluated during PatchCollection creation. It appears that an issue was never created for this... please let me know if I'm being stupid and not noticing one.
As such, the StreamplotSet.arrows PatchCollection appears to be entirely useless. In fact, streamplot() doesn't even add the collection to the axis, instead adding the individual patches, and then creating an apparently unused PatchCollection to return. This means that things that should work, like, for a StreamplotSet s, doing s.arrows.set_visible(False), will not work, nor, to my knowledge, will doing anything with StreamplotSet.arrows have the desired result.
As discussed in the mailing list thread, one potential solution to this would be to create a FancyArrowPatchCollection class especially for FancyArrowPatch, and then use this for streamplot; someone in the thread also gives a rudimentary class. If I have time, I might try to implement this, but does anyone have any better ideas?
I'm guessing incompatibilities between FancyArrowPatch and PatchCollection was the reason the arrow collection is not added to axes. (To be honest, I don't remember.) I'm not sure what a full implementation of a FancyArrowPatchCollection would require, so I tried implementing a simpler fix using FancyArrow instead (See PR #2500).
I had a quick look at this. I think the solution likely involves using PatchCollection with TransformedPatchPath entries, so that the transform info stays in the collection. But additionally, the draw-time computation done in FancyArrowPatch will need to move from get_path_in_displaycoord to a custom transform subclass, which contains the relevant logic but will be able to be combined with other transforms); this is likely the trickier part.
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
tonysyu commentedon Oct 6, 2013
I'm guessing incompatibilities between
FancyArrowPatchandPatchCollectionwas the reason the arrow collection is not added to axes. (To be honest, I don't remember.) I'm not sure what a full implementation of aFancyArrowPatchCollectionwould require, so I tried implementing a simpler fix usingFancyArrowinstead (See PR #2500).tacaswell commentedon Aug 17, 2014
@cgevans Did you make any progress on this?
@tonysyu Any interest in reviving #2500?
petehuang commentedon Dec 31, 2016
Confirming this is still an issue in 1.5.3
PR still welcome here, would recommend reading through #2500 despite it stalling.
Recommend labeling with confirmed bug
rodogi commentedon Dec 13, 2017
Just to comment that fixing this bug will benefit networkx arrow-drawing (see here) as arrows are
FancyArrowPatchinstances.anntzer commentedon Jan 20, 2021
I had a quick look at this. I think the solution likely involves using PatchCollection with TransformedPatchPath entries, so that the transform info stays in the collection. But additionally, the draw-time computation done in FancyArrowPatch will need to move from
get_path_in_displaycoordto a custom transform subclass, which contains the relevant logic but will be able to be combined with other transforms); this is likely the trickier part.yves-surrel commentedon Nov 7, 2021
Will this bug be ever fixed? I need to plot hundreds of annotations and it is awfully slow...
github-actions commentedon Mar 3, 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!
robintheconqueror commentedon Apr 2, 2024
My
some_streamplotset.arrows.remove()continues to fail... Any updates on this?