Skip to content

Autoscale does not work for ax.arrow() #12712

Closed
@CakeUser321

Description

@CakeUser321

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

import matplotlib.pyplot as plt
import matplotlib
import sys

print(matplotlib.__version__)
print(sys.version)
fig, ax = plt.subplots()
#ax.set_xlim(0, 5)
#ax.set_ylim(0, 5)
ax.arrow(1, 1, 1, 1)
plt.show()

Output:

3.0.1
3.7.0 (default, Oct  9 2018, 10:31:47) 
[GCC 7.3.0]

plot_issue

Outcome with setting limits manually

plot_right

Matplotlib version

  • Operating system: Xubuntu 18.04
  • Matplotlib version: 3.0.1
  • Matplotlib backend (print(matplotlib.get_backend())): Qt5Agg
  • Python version: 3.7.0
  • Jupyter version (if applicable):
  • Other libraries:

I installed matplotlib by using anaconda.

I didn't specify a channel, so I guess it was the main channel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions