X Tutup
Skip to content

Autoscale for ax.arrow()#15392

Merged
QuLogic merged 1 commit intomatplotlib:masterfrom
choyiny:arrow-autoscale
Mar 25, 2020
Merged

Autoscale for ax.arrow()#15392
QuLogic merged 1 commit intomatplotlib:masterfrom
choyiny:arrow-autoscale

Conversation

@choyiny
Copy link
Copy Markdown
Contributor

@choyiny choyiny commented Oct 8, 2019

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 lazily call autoscale_view() after adding it on the axes.

Part of a course at University of Toronto with @atafliovich.

Resolves #12712
Takes over #13788

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Autoscale does not work for ax.arrow()

5 participants

X Tutup