-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
WIP: Fix streamplot set #2500
WIP: Fix streamplot set #2500
Conversation
Hmmm, I think my vote would be to fix FancyArrowPatch. Although, I have to |
@@ -85,13 +86,21 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None, | |||
if linewidth is None: | |||
linewidth = matplotlib.rcParams['lines.linewidth'] | |||
|
|||
if arrowstyle is not None: | |||
print(arrowstyle) | |||
warn("`arrowstyle` parameter is deprecated and no longer used") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the matplotlib deprecation warning (I think it is in cbook)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it is less a deprecation, more an outright removal, so I'd consider raising an Exception (others - does that fit with how you would do things here?)
@tonysyu Where does this stand? In any case it needs a re-base again. |
@tacaswell Thanks for bumping the PR. I'm not really sure where this stands, though. I submitted this PR to get feedback about some of the design decisions, but I don't think I'm any closer to reaching a conclusion. In retrospect, I think I really don't like breaking the API and replacing |
Closing until @tonysyu is happy with the PR. |
Currently,
streamplot
returns a not-so-usefulStreamplotSet
containing the line and arrow collections drawn on the figure. One major problem was that the arrow collection created was never added to the axes (each arrow patch was added separately). Unfortunately, making the arrows a truePatchCollection
is a bit difficult:FancyArrowPatch
doesn't seem to play nice withPatchCollection
.To fix these issues this PR:
FancyArrow
instead ofFancyArrowPatch
StreamplotSet
aCompositeCollection
.The consequences are that:
arrowstyle
needs to be deprecated as an argument tostreamplot
CompositeCollection
may be a bit too magical (it automatically delegates attribute access to sub-collections)Alternatives:
FancyArrowPatch
to work withPatchCollection
. This probably requires some transform knowledge that I'm missing.CompositeCollection
, just add some subset of collection methods/attrs that the set should support.Note: Changes to
pyplot.py
were generated byboilerplate.py
.