From 6e3a8bbd6e78578c4b260d51175f720a32ece51e Mon Sep 17 00:00:00 2001 From: Mike Kaufman Date: Sun, 10 Jun 2012 10:34:41 -0400 Subject: [PATCH 1/2] update axes.arrow() and patches.FancyArrow documentation to make more informative and add missing options modified: lib/matplotlib/axes.py modified: lib/matplotlib/patches.py --- lib/matplotlib/axes.py | 4 ++-- lib/matplotlib/patches.py | 29 +++++++++++++++++++---------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 42208cd1e71b..d2dec622cd80 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -6372,9 +6372,9 @@ def arrow(self, x, y, dx, dy, **kwargs): arrow(x, y, dx, dy, **kwargs) Draws arrow on specified axis from (*x*, *y*) to (*x* + *dx*, - *y* + *dy*). + *y* + *dy*). Uses FancyArrow patch to construct the arrow. - Optional kwargs control the arrow properties: + Optional kwargs control the arrow construction and properties: %(FancyArrow)s diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py index 9bbbddc44f2f..5c23e3fbb9ca 100644 --- a/lib/matplotlib/patches.py +++ b/lib/matplotlib/patches.py @@ -920,21 +920,30 @@ def __init__(self, x, y, dx, dy, width=0.001, length_includes_head=False, \ head_starts_at_zero=False,**kwargs): """ Constructor arguments + width: float (default: 0.001) + width of full arrow tail - *length_includes_head*: - *True* if head is counted in calculating the length. + length_includes_head: [True | False] (default: False) + True if head is to be counted in calculating the length. - *shape*: ['full', 'left', 'right'] + head_width: float or None (default: 3*width) + total width of the full arrow head - *overhang*: - distance that the arrow is swept back (0 overhang means - triangular shape). + head_length: float or None (default: 1.5 * head_width) + length of arrow head - *head_starts_at_zero*: - If *True*, the head starts being drawn at coordinate 0 - instead of ending at coordinate 0. + shape: ['full', 'left', 'right'] (default: 'full') + draw the left-half, right-half, or full arrow - Valid kwargs are: + overhang: float (default: 0) + fraction that the arrow is swept back (0 overhang means + triangular shape). Can be negative or greater than one. + + head_starts_at_zero: [True | False] (default: False) + if True, the head starts being drawn at coordinate 0 + instead of ending at coordinate 0. + + Other valid kwargs (inherited from Patch) are: %(Patch)s """ From 18ca8126d9e506f0fef0a93ef04343f6e16a0b20 Mon Sep 17 00:00:00 2001 From: Mike Kaufman Date: Mon, 11 Jun 2012 19:56:33 -0400 Subject: [PATCH 2/2] add sphinx markup to documentation modified: lib/matplotlib/patches.py --- lib/matplotlib/patches.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py index 5c23e3fbb9ca..d4ad79d808f6 100644 --- a/lib/matplotlib/patches.py +++ b/lib/matplotlib/patches.py @@ -920,30 +920,30 @@ def __init__(self, x, y, dx, dy, width=0.001, length_includes_head=False, \ head_starts_at_zero=False,**kwargs): """ Constructor arguments - width: float (default: 0.001) + *width*: float (default: 0.001) width of full arrow tail - length_includes_head: [True | False] (default: False) + *length_includes_head*: [True | False] (default: False) True if head is to be counted in calculating the length. - head_width: float or None (default: 3*width) + *head_width*: float or None (default: 3*width) total width of the full arrow head - head_length: float or None (default: 1.5 * head_width) + *head_length*: float or None (default: 1.5 * head_width) length of arrow head - shape: ['full', 'left', 'right'] (default: 'full') + *shape*: ['full', 'left', 'right'] (default: 'full') draw the left-half, right-half, or full arrow - overhang: float (default: 0) + *overhang*: float (default: 0) fraction that the arrow is swept back (0 overhang means triangular shape). Can be negative or greater than one. - head_starts_at_zero: [True | False] (default: False) + *head_starts_at_zero*: [True | False] (default: False) if True, the head starts being drawn at coordinate 0 instead of ending at coordinate 0. - Other valid kwargs (inherited from Patch) are: + Other valid kwargs (inherited from :class:`Patch`) are: %(Patch)s """