-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Autoscale for ax.arrow() #13788
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
Autoscale for ax.arrow() #13788
Conversation
In view of #11350 I'd be interested to know what use case people have for |
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.
This looks good to me. For the test, instead of adding a new image (we try and avoid that) could you instead add a manual check that the axes limits change to include the arrow after the axes are autoscaled?
Looking forward to this fix ! thanks |
This will also need an API change note. There are likely users who are relying on this not auto-scaling and they need to be notified. |
@liujordan please don't give up ! I want your fix :p |
Taking over from @liujordan. This was previously a student project at University of Toronto Scarborough with Dr. Anya Tafliovich (@atafliovich). |
A major change I made was removing the |
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.
Please remove the unused image file and squash your commits.
Looks like something went wrong with the rebase? :( |
Trying to fix it now. |
I was unable to fix this branch, so restarted in another PR #15392 |
Closing for other pr |
can try mptcpanalyzer -dDEBUG "plot dss examples/client_2_filtered.pcapng 1 --dest=Server" "quit" There is an issue with autoscaling not working because FancyArrows are drawn as artists rather than patches see matplotlib/matplotlib#13788
PR Summary
When ax.arrow() is called, a FancyArrow object is being added to the current axes as an artist and not a patch. So when autoscale_view is called, which loops through all Patches and scales the view based on the minimum and maximum of those, the FancyArrow isn't being considered.
The solution is a two-step process. First, we have to add the arrow as a Patch, and second, we have to call autoscale_view() after adding it on the axes.
Resolves #12712
PR Checklist