[*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)
| 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): |