Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MNT: Discourage arrow()#29509

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
rcomer merged 1 commit intomatplotlib:mainfromtimhoffm:mnt-discourage-arrow
Jan 25, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletionslib/matplotlib/axes/_axes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5432,10 +5432,22 @@ def on_changed(collection):
@_docstring.interpd
def arrow(self, x, y, dx, dy, **kwargs):
"""
Add an arrow to the Axes.
[*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 resulting arrow
is affected by the Axes aspect ratio and limits, which may distort
the arrow.

Consider using `~.Axes.annotate` without a text instead, e.g. ::

ax.annotate("", xytext=(0, 0), xy=(0.5, 0.5),
arrowprops=dict(arrowstyle="->"))

Parameters
----------
%(FancyArrow)s
Expand All@@ -5444,17 +5456,6 @@ def arrow(self, x, y, dx, dy, **kwargs):
-------
`.FancyArrow`
The created `.FancyArrow` object.

Notes
-----
The resulting arrow is affected by the Axes aspect ratio and limits.
This may produce an arrow whose head is not square with its stem. To
create an arrow whose head is square with its stem,
use :meth:`annotate` for example:

>>> ax.annotate("", xy=(0.5, 0.5), xytext=(0, 0),
... arrowprops=dict(arrowstyle="->"))

"""
# Strip away units for the underlying patch since units
# do not make sense to most patch-like code
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp