Skip to content

Make ArrowStyle docstrings numpydoc compatible #8343

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 5 commits into from
Mar 24, 2017
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
184 changes: 100 additions & 84 deletions lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -3424,11 +3424,13 @@ class CurveA(_Curve):

def __init__(self, head_length=.4, head_width=.2):
"""
*head_length*
length of the arrow head
Parameters
----------
head_length : float, optional, default : 0.4
Length of the arrow head

*head_width*
width of the arrow head
head_width : float, optional, default : 0.2
Width of the arrow head
"""

super(ArrowStyle.CurveA, self).__init__(
Expand All @@ -3444,11 +3446,13 @@ class CurveB(_Curve):

def __init__(self, head_length=.4, head_width=.2):
"""
*head_length*
length of the arrow head
Parameters
----------
head_length : float, optional, default : 0.4
Length of the arrow head

*head_width*
width of the arrow head
head_width : float, optional, default : 0.2
Width of the arrow head
"""

super(ArrowStyle.CurveB, self).__init__(
Expand All @@ -3464,11 +3468,13 @@ class CurveAB(_Curve):

def __init__(self, head_length=.4, head_width=.2):
"""
*head_length*
length of the arrow head
Parameters
----------
head_length : float, optional, default : 0.4
Length of the arrow head

*head_width*
width of the arrow head
head_width : float, optional, default : 0.2
Width of the arrow head
"""

super(ArrowStyle.CurveAB, self).__init__(
Expand All @@ -3484,11 +3490,13 @@ class CurveFilledA(_Curve):

def __init__(self, head_length=.4, head_width=.2):
"""
*head_length*
length of the arrow head
Parameters
----------
head_length : float, optional, default : 0.4
Length of the arrow head

*head_width*
width of the arrow head
head_width : float, optional, default : 0.2
Width of the arrow head
"""

super(ArrowStyle.CurveFilledA, self).__init__(
Expand All @@ -3505,11 +3513,13 @@ class CurveFilledB(_Curve):

def __init__(self, head_length=.4, head_width=.2):
"""
*head_length*
length of the arrow head
Parameters
----------
head_length : float, optional, default : 0.4
Length of the arrow head

*head_width*
width of the arrow head
head_width : float, optional, default : 0.2
Width of the arrow head
"""

super(ArrowStyle.CurveFilledB, self).__init__(
Expand All @@ -3521,17 +3531,18 @@ def __init__(self, head_length=.4, head_width=.2):

class CurveFilledAB(_Curve):
"""
An arrow with filled triangle heads both at the begin and the end
point.
An arrow with filled triangle heads at both ends.
"""

def __init__(self, head_length=.4, head_width=.2):
"""
*head_length*
length of the arrow head
Parameters
----------
head_length : float, optional, default : 0.4
Length of the arrow head

*head_width*
width of the arrow head
head_width : float, optional, default : 0.2
Width of the arrow head
"""

super(ArrowStyle.CurveFilledAB, self).__init__(
Expand Down Expand Up @@ -3620,30 +3631,32 @@ def transmute(self, path, mutation_size, linewidth):

class BracketAB(_Bracket):
"""
An arrow with a bracket(]) at both ends.
An arrow with a bracket(]) at both ends.
"""

def __init__(self,
widthA=1., lengthA=0.2, angleA=None,
widthB=1., lengthB=0.2, angleB=None):
"""
*widthA*
width of the bracket
Parameters
----------
widthA : float, optional, default : 1.0
Width of the bracket

*lengthA*
length of the bracket
lengthA : float, optional, default : 0.2
Length of the bracket

*angleA*
angle between the bracket and the line
angleA : float, optional, default : None
Angle between the bracket and the line

*widthB*
width of the bracket
widthB : float, optional, default : 1.0
Width of the bracket

*lengthB*
length of the bracket
lengthB : float, optional, default : 0.2
Length of the bracket

*angleB*
angle between the bracket and the line
angleB : float, optional, default : None
Angle between the bracket and the line
"""

super(ArrowStyle.BracketAB, self).__init__(
Expand All @@ -3660,14 +3673,16 @@ class BracketA(_Bracket):

def __init__(self, widthA=1., lengthA=0.2, angleA=None):
"""
*widthA*
width of the bracket
Parameters
----------
widthA : float, optional, default : 1.0
Width of the bracket

*lengthA*
length of the bracket
lengthA : float, optional, default : 0.2
Length of the bracket

*angleA*
angle between the bracket and the line
angleA : float, optional, default : None
Angle between the bracket and the line
"""

super(ArrowStyle.BracketA, self).__init__(True, None,
Expand All @@ -3684,14 +3699,16 @@ class BracketB(_Bracket):

def __init__(self, widthB=1., lengthB=0.2, angleB=None):
"""
*widthB*
width of the bracket
Parameters
----------
widthB : float, optional, default : 1.0
Width of the bracket

*lengthB*
length of the bracket
lengthB : float, optional, default : 0.2
Length of the bracket

*angleB*
angle between the bracket and the line
angleB : float, optional, default : None
Angle between the bracket and the line
"""

super(ArrowStyle.BracketB, self).__init__(None, True,
Expand All @@ -3710,23 +3727,19 @@ def __init__(self,
widthA=1., angleA=None,
widthB=1., angleB=None):
"""
*widthA*
width of the bracket

*lengthA*
length of the bracket

*angleA*
angle between the bracket and the line
Parameters
----------
widthA : float, optional, default : 1.0
Width of the bracket

*widthB*
width of the bracket
angleA : float, optional, default : None
Angle between the bracket and the line

*lengthB*
length of the bracket
widthB : float, optional, default : 1.0
Width of the bracket

*angleB*
angle between the bracket and the line
angleB : float, optional, default : None
Angle between the bracket and the line
"""

super(ArrowStyle.BarAB, self).__init__(
Expand All @@ -3742,15 +3755,16 @@ class Simple(_Base):

def __init__(self, head_length=.5, head_width=.5, tail_width=.2):
"""
*head_length*
length of the arrow head

*head_with*
width of the arrow head
Parameters
----------
head_length : float, optional, default : 0.5
Length of the arrow head

*tail_width*
width of the arrow tail
head_width : float, optional, default : 0.5
Width of the arrow head

tail_width : float, optional, default : 0.2
Width of the arrow tail
"""

self.head_length, self.head_width, self.tail_width = \
Expand Down Expand Up @@ -3828,15 +3842,16 @@ class Fancy(_Base):

def __init__(self, head_length=.4, head_width=.4, tail_width=.4):
"""
*head_length*
length of the arrow head

*head_with*
width of the arrow head
Parameters
----------
head_length : float, optional, default : 0.4
Length of the arrow head

*tail_width*
width of the arrow tail
head_width : float, optional, default : 0.4
Width of the arrow head

tail_width : float, optional, default : 0.4
Width of the arrow tail
"""

self.head_length, self.head_width, self.tail_width = \
Expand Down Expand Up @@ -3928,16 +3943,17 @@ class Wedge(_Base):
Wedge(?) shape. Only works with a quadratic bezier curve. The
begin point has a width of the tail_width and the end point has a
width of 0. At the middle, the width is shrink_factor*tail_width.

"""

def __init__(self, tail_width=.3, shrink_factor=0.5):
"""
*tail_width*
width of the tail
Parameters
----------
tail_width : float, optional, default : 0.3
Width of the tail

*shrink_factor*
fraction of the arrow width at the middle point
shrink_factor : float, optional, default : 0.5
Fraction of the arrow width at the middle point
"""

self.tail_width = tail_width
Expand Down