From 62bcf04b66da2dc15fcf4d63f09e8e0b95aaf6e1 Mon Sep 17 00:00:00 2001 From: mobando Date: Mon, 5 Sep 2016 15:29:57 +0100 Subject: [PATCH 1/6] DOC Updated documentation of arrow function to numpy docs format. --- lib/matplotlib/axes/_axes.py | 43 ++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 0cba4d225e36..2a727c13e14c 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -4522,13 +4522,35 @@ def arrow(self, x, y, dx, dy, **kwargs): """ Add an arrow to the axes. - Call signature:: - - arrow(x, y, dx, dy, **kwargs) - - Draws arrow on specified axis from (*x*, *y*) to (*x* + *dx*, - *y* + *dy*). Uses FancyArrow patch to construct the arrow. - + 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 in x-coordinate + dy : float + Length of arrow in y-coordinate + + Return + ------ + a : FancyArrow + patches.FancyArrow object + + Other Parameters + ----------------- + kwargs : `~matplotlib.patches.FancyArrow` properties. + + See also + -------- + %(FancyArrow)s : Parent object type. + + 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 @@ -4537,11 +4559,8 @@ 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 """ From ac0f466d6180d7e476606c93b7f807fbe09a0bc4 Mon Sep 17 00:00:00 2001 From: mobando Date: Mon, 5 Sep 2016 16:20:58 +0100 Subject: [PATCH 2/6] DOC Indented documentation with spaces instead of tabs. --- lib/matplotlib/axes/_axes.py | 48 ++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 2a727c13e14c..2533219760b9 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -4525,31 +4525,31 @@ def arrow(self, x, y, dx, dy, **kwargs): 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 in x-coordinate - dy : float - Length of arrow in y-coordinate - - Return - ------ - a : FancyArrow - patches.FancyArrow object - - Other Parameters - ----------------- - kwargs : `~matplotlib.patches.FancyArrow` properties. - - See also - -------- + Parameters + ---------- + x : float + X-coordinate of the arrow base + y : float + Y-coordinate of the arrow base + dx : float + Length of arrow in x-coordinate + dy : float + Length of arrow in y-coordinate + + Return + ------ + a : FancyArrow + patches.FancyArrow object + + Other Parameters + ----------------- + kwargs : `~matplotlib.patches.FancyArrow` properties. + + See also + -------- %(FancyArrow)s : Parent object type. - Notes + 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 @@ -4560,7 +4560,7 @@ def arrow(self, x, y, dx, dy, **kwargs): arrowprops=dict(arrowstyle="->")) Examples - -------- + -------- .. plot:: mpl_examples/pylab_examples/arrow_demo.py """ From b6c49e4bede1c8573fd769e750b89ab61b1b43b1 Mon Sep 17 00:00:00 2001 From: mobando Date: Mon, 5 Sep 2016 18:59:04 +0100 Subject: [PATCH 3/6] DOC Fixed typo in documentation --- lib/matplotlib/axes/_axes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 2533219760b9..b4c5f9c5f600 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -4536,8 +4536,8 @@ def arrow(self, x, y, dx, dy, **kwargs): dy : float Length of arrow in y-coordinate - Return - ------ + Returns + ------- a : FancyArrow patches.FancyArrow object From 5ed7809af35269664a181b7c8a55325b9172ee13 Mon Sep 17 00:00:00 2001 From: mobando Date: Mon, 5 Sep 2016 19:00:06 +0100 Subject: [PATCH 4/6] DOC Fixed Syntax breaking up sphinx (TODO make a bug report) --- lib/matplotlib/axes/_axes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index b4c5f9c5f600..15787f88dffb 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -4545,8 +4545,8 @@ def arrow(self, x, y, dx, dy, **kwargs): ----------------- kwargs : `~matplotlib.patches.FancyArrow` properties. - See also - -------- + More valid arguments include: + %(FancyArrow)s : Parent object type. Notes From a008555de2f707bc07643d07cd89cad103499ed3 Mon Sep 17 00:00:00 2001 From: mobando Date: Wed, 21 Sep 2016 17:41:32 +0200 Subject: [PATCH 5/6] FIX Repaired wording and whitespace problems --- lib/matplotlib/axes/_axes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 15787f88dffb..fc3dfdd2a172 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -4532,9 +4532,9 @@ def arrow(self, x, y, dx, dy, **kwargs): y : float Y-coordinate of the arrow base dx : float - Length of arrow in x-coordinate + Length of arrow along x-coordinate dy : float - Length of arrow in y-coordinate + Length of arrow along y-coordinate Returns ------- @@ -4563,6 +4563,7 @@ def arrow(self, x, y, dx, dy, **kwargs): -------- .. plot:: mpl_examples/pylab_examples/arrow_demo.py + """ # Strip away units for the underlying patch since units # do not make sense to most patch-like code From ee5953aa113764a71f53121ec73f4a57195f46b6 Mon Sep 17 00:00:00 2001 From: mobando Date: Thu, 22 Sep 2016 09:40:39 +0200 Subject: [PATCH 6/6] Fixed template rendering by leaving template alone in line. --- lib/matplotlib/axes/_axes.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index fc3dfdd2a172..17bff4ad7717 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -4543,11 +4543,10 @@ def arrow(self, x, y, dx, dy, **kwargs): Other Parameters ----------------- - kwargs : `~matplotlib.patches.FancyArrow` properties. + Optional kwargs (inherited from FancyArrow patch) control the arrow + construction and properties: - More valid arguments include: - - %(FancyArrow)s : Parent object type. + %(FancyArrow)s Notes -----