Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8c18a37

Browse files
committed
added fix for 12712
1 parent ddb38ae commit 8c18a37

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4964,7 +4964,8 @@ def arrow(self, x, y, dx, dy, **kwargs):
49644964
dy = self.convert_yunits(dy)
49654965

49664966
a = mpatches.FancyArrow(x, y, dx, dy, **kwargs)
4967-
self.add_artist(a)
4967+
self.add_patch(a)
4968+
self.autoscale_view()
49684969
return a
49694970

49704971
def quiverkey(self, Q, X, Y, U, label, **kw):

lib/matplotlib/tests/test_axes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,11 @@ def test_arrow_empty():
384384
# Create an empty FancyArrow
385385
ax.arrow(0, 0, 0, 0, head_length=0)
386386

387+
@image_comparison(baseline_images=['arrow_in_view'],
388+
extensions=['png'], remove_text=True)
389+
def test_arrow_in_view():
390+
fig, ax = plt.subplots()
391+
ax.arrow(1, 1, 1, 1)
387392

388393
def test_annotate_default_arrow():
389394
# Check that we can make an annotation arrow with only default properties.

0 commit comments

Comments
 (0)