Skip to content

Bug Fix: Issue #6000 - #6093

Closed
klampzlamps wants to merge 1 commit into
matplotlib:masterfrom
klampzlamps:Issue6000
Closed

klampzlamps wants to merge 1 commit into
matplotlib:masterfrom
klampzlamps:Issue6000

Conversation

@klampzlamps

Copy link
Copy Markdown

For issue #6000 , the problem was that calling streamplot.arrows.set_visible(False) was setting the PatchCollection instance's visible flag to False, and when the arrows were being rendered only the arrow's visible flag was checked (bypassing the check to PatchCollection altogether). This is why the arrows were drawn even when the collection's visible flag was False.

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 the transform=transform parameter from the FancyArrowPatch 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.



def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
cmap=None, norm=None, arrowsize=1, arrowstyle='-|>',

Copy link
Copy Markdown
Member

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.

@tacaswell

Copy link
Copy Markdown
Member

This is going to end up coupled with #6054 I suspect.

@tacaswell tacaswell added this to the 2.0.1 (next bug fix release) milestone Mar 2, 2016
Comment thread lib/matplotlib/axes/_axes.py Outdated

showbox : bool, default = True
If True, will toggle on the rendering of the box
If True, will toggle on the rendering of box

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Author

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.

@QuLogic

QuLogic commented Mar 2, 2016

Copy link
Copy Markdown
Member

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.)

@tacaswell

Copy link
Copy Markdown
Member

Please remove the API change.

@QuLogic QuLogic modified the milestones: 2.0.1 (next bug fix release), 2.0.2 (next bug fix release) May 3, 2017
@tacaswell tacaswell modified the milestones: 2.1.1 (next bug fix release), 2.2 (next feature release) Oct 9, 2017
@sharma7

sharma7 commented Mar 14, 2018 •

Copy link
Copy Markdown

@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?

@jklymak

jklymak commented Jul 14, 2020

Copy link
Copy Markdown
Member

I'll close this fix, though someone could use it to make their own...

@jklymak jklymak closed this Jul 14, 2020
@story645 story645 removed this from the future releases milestone Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants