-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Autoscale does not work for ax.arrow() #12712
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
Comments
|
After doing some investigating into the bug, I realized that if the view is set by To reproduce: fig, ax = plt.subplots()
# ax.set_xlim(0, 5)
# ax.set_ylim(0, 5)
ax.plot([1, 2], [2, 1], label='foo')
ax.arrow(3, 3, 3, 3)
plt.show() Note how only the graph will only show the line drawn by Adding the arrow as a patch and calling Edit: Seems like #13593 is relevant here, we should probably not call |
great news. Thanks for solving this ! |
Bug report
As already stated in this stack overflow thread, when drawing arrows with the arrow()-method, the scale of the plot is not adjusted as expected. A workaround is to set the limits of the plot manually or to plot additional, invisible points near the arrows.
Code for Reproducing the bug
Output:
Outcome with setting limits manually
Matplotlib version
print(matplotlib.get_backend())
): Qt5AggI installed matplotlib by using anaconda.
I didn't specify a channel, so I guess it was the main channel.
The text was updated successfully, but these errors were encountered: