MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / arrow

Method arrow

lib/matplotlib/axes/_axes.py:5876–5913  ·  view source on GitHub ↗

[*Discouraged*] Add an arrow to the Axes. This draws an arrow from ``(x, y)`` to ``(x+dx, y+dy)``. .. admonition:: Discouraged The use of this method is discouraged because it is not guaranteed that the arrow renders reasonably. For example, the re

(self, x, y, dx, dy, **kwargs)

Source from the content-addressed store, hash-verified

5874
5875 @_docstring.interpd
5876 def arrow(self, x, y, dx, dy, **kwargs):
5877 """
5878 [*Discouraged*] Add an arrow to the Axes.
5879
5880 This draws an arrow from ``(x, y)`` to ``(x+dx, y+dy)``.
5881
5882 .. admonition:: Discouraged
5883
5884 The use of this method is discouraged because it is not guaranteed
5885 that the arrow renders reasonably. For example, the resulting arrow
5886 is affected by the Axes aspect ratio and limits, which may distort
5887 the arrow.
5888
5889 Consider using `~.Axes.annotate` without a text instead, e.g. ::
5890
5891 ax.annotate("", xytext=(0, 0), xy=(0.5, 0.5),
5892 arrowprops=dict(arrowstyle="->"))
5893
5894 Parameters
5895 ----------
5896 %(FancyArrow)s
5897
5898 Returns
5899 -------
5900 `.FancyArrow`
5901 The created `.FancyArrow` object.
5902 """
5903 # Strip away units for the underlying patch since units
5904 # do not make sense to most patch-like code
5905 x = self.convert_xunits(x)
5906 y = self.convert_yunits(y)
5907 dx = self.convert_xunits(dx)
5908 dy = self.convert_yunits(dy)
5909
5910 a = mpatches.FancyArrow(x, y, dx, dy, **kwargs)
5911 self.add_patch(a)
5912 self._request_autoscale_view()
5913 return a
5914
5915 @_docstring.copy(mquiver.QuiverKey.__init__)
5916 def quiverkey(self, Q, X, Y, U, label, **kwargs):

Callers 9

arrowFunction · 0.80
test_arrowMethod · 0.80
test_arrow_simpleFunction · 0.80
test_arrow_emptyFunction · 0.80
test_arrow_in_viewFunction · 0.80
test_fancyarrow_setdataFunction · 0.80
test_empty_fancyarrowFunction · 0.80
arrow_guide.pyFile · 0.80
make_arrow_graphFunction · 0.80

Calls 4

convert_xunitsMethod · 0.80
convert_yunitsMethod · 0.80
add_patchMethod · 0.80

Tested by 6

test_arrowMethod · 0.64
test_arrow_simpleFunction · 0.64
test_arrow_emptyFunction · 0.64
test_arrow_in_viewFunction · 0.64
test_fancyarrow_setdataFunction · 0.64
test_empty_fancyarrowFunction · 0.64