Skip to content

[WIP] DOC Updated documentation of arrow function to numpy docs format. #7029

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 24, 2016
Merged
Changes from all 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
37 changes: 28 additions & 9 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4522,13 +4522,34 @@ def arrow(self, x, y, dx, dy, **kwargs):
"""
Add an arrow to the axes.

Call signature::
Draws arrow on specified axis from (`x`, `y`) to (`x` + `dx`,
`y` + `dy`). Uses FancyArrow patch to construct the arrow.

Parameters
----------
x : float
X-coordinate of the arrow base
y : float
Y-coordinate of the arrow base
dx : float
Length of arrow along x-coordinate
dy : float
Length of arrow along y-coordinate

Returns
-------
a : FancyArrow
patches.FancyArrow object

arrow(x, y, dx, dy, **kwargs)
Other Parameters
-----------------
Optional kwargs (inherited from FancyArrow patch) control the arrow
construction and properties:

Draws arrow on specified axis from (*x*, *y*) to (*x* + *dx*,
*y* + *dy*). Uses FancyArrow patch to construct the arrow.
%(FancyArrow)s

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
Expand All @@ -4537,13 +4558,11 @@ def arrow(self, x, y, dx, dy, **kwargs):
ax.annotate("", xy=(0.5, 0.5), xytext=(0, 0),
arrowprops=dict(arrowstyle="->"))

Optional kwargs control the arrow construction and properties:

%(FancyArrow)s

**Example:**
Examples
--------

.. plot:: mpl_examples/pylab_examples/arrow_demo.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a blank line after this? I am not entirely sure why, but python3.5 is unhappy…

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I wasn't clear: I meant after the ".. plot::" directive.


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