-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Bug Fix: Issue #6000 #6093
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
Bug Fix: Issue #6000 #6093
Conversation
lib/matplotlib/streamplot.py
Outdated
@@ -20,7 +20,7 @@ | |||
|
|||
|
|||
def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None, | |||
cmap=None, norm=None, arrowsize=1, arrowstyle='-|>', |
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.
Changing the defaults is an API change which we should only do with a very good reason.
This is going to end up coupled with #6054 I suspect. |
lib/matplotlib/axes/_axes.py
Outdated
@@ -3153,7 +3153,7 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None, | |||
If True, will toggle on the rendering of the caps | |||
|
|||
showbox : bool, default = True | |||
If True, will toggle on the rendering of the box | |||
If True, will toggle on the rendering of box |
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.
I don't really know why you changed any of these docstrings.
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.
Woops, looks like I accidentally used an older _axes.py file when making the changes.
Please rebase, and squash the unnecessary commits (e.g., adding and removing extra files) and (force) push an update once you have corrected the comments. (A new PR would not be necessary.) |
Please remove the API change. |
@tacaswell I see that work on this bug has come to a halt. I'm just wondering if it was the right approach, whether I should continue on this approach and what the next steps are? |
I'll close this fix, though someone could use it to make their own... |
For issue #6000 , the problem was that calling
streamplot.arrows.set_visible(False)
was setting thePatchCollection
instance's visible flag to False, and when the arrows were being rendered only the arrow's visible flag was checked (bypassing the check toPatchCollection
altogether). This is why the arrows were drawn even when the collection's visible flag wasFalse
.The fix was simply to add the arrows at the end as a whole collection to the
axes
(instead of adding them one at time), and also removing thetransform=transform
parameter from theFancyArrowPatch
creation since it is no longer needed. However I noticed that the default arrow style of '-|>' did not work as some arrows were misplaced so I changed the default style to 'wedge' and this seems to work just fine.