Skip to content

Commit fc547f4

Browse files
authored
Merge pull request #8343 from patniharshit/arrowStyleDocstring
Make ArrowStyle docstrings numpydoc compatible
2 parents 75babe6 + 389d85b commit fc547f4

File tree

1 file changed

+100
-84
lines changed

1 file changed

+100
-84
lines changed

lib/matplotlib/patches.py

+100-84
Original file line numberDiff line numberDiff line change
@@ -3424,11 +3424,13 @@ class CurveA(_Curve):
34243424

34253425
def __init__(self, head_length=.4, head_width=.2):
34263426
"""
3427-
*head_length*
3428-
length of the arrow head
3427+
Parameters
3428+
----------
3429+
head_length : float, optional, default : 0.4
3430+
Length of the arrow head
34293431
3430-
*head_width*
3431-
width of the arrow head
3432+
head_width : float, optional, default : 0.2
3433+
Width of the arrow head
34323434
"""
34333435

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

34453447
def __init__(self, head_length=.4, head_width=.2):
34463448
"""
3447-
*head_length*
3448-
length of the arrow head
3449+
Parameters
3450+
----------
3451+
head_length : float, optional, default : 0.4
3452+
Length of the arrow head
34493453
3450-
*head_width*
3451-
width of the arrow head
3454+
head_width : float, optional, default : 0.2
3455+
Width of the arrow head
34523456
"""
34533457

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

34653469
def __init__(self, head_length=.4, head_width=.2):
34663470
"""
3467-
*head_length*
3468-
length of the arrow head
3471+
Parameters
3472+
----------
3473+
head_length : float, optional, default : 0.4
3474+
Length of the arrow head
34693475
3470-
*head_width*
3471-
width of the arrow head
3476+
head_width : float, optional, default : 0.2
3477+
Width of the arrow head
34723478
"""
34733479

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

34853491
def __init__(self, head_length=.4, head_width=.2):
34863492
"""
3487-
*head_length*
3488-
length of the arrow head
3493+
Parameters
3494+
----------
3495+
head_length : float, optional, default : 0.4
3496+
Length of the arrow head
34893497
3490-
*head_width*
3491-
width of the arrow head
3498+
head_width : float, optional, default : 0.2
3499+
Width of the arrow head
34923500
"""
34933501

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

35063514
def __init__(self, head_length=.4, head_width=.2):
35073515
"""
3508-
*head_length*
3509-
length of the arrow head
3516+
Parameters
3517+
----------
3518+
head_length : float, optional, default : 0.4
3519+
Length of the arrow head
35103520
3511-
*head_width*
3512-
width of the arrow head
3521+
head_width : float, optional, default : 0.2
3522+
Width of the arrow head
35133523
"""
35143524

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

35223532
class CurveFilledAB(_Curve):
35233533
"""
3524-
An arrow with filled triangle heads both at the begin and the end
3525-
point.
3534+
An arrow with filled triangle heads at both ends.
35263535
"""
35273536

35283537
def __init__(self, head_length=.4, head_width=.2):
35293538
"""
3530-
*head_length*
3531-
length of the arrow head
3539+
Parameters
3540+
----------
3541+
head_length : float, optional, default : 0.4
3542+
Length of the arrow head
35323543
3533-
*head_width*
3534-
width of the arrow head
3544+
head_width : float, optional, default : 0.2
3545+
Width of the arrow head
35353546
"""
35363547

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

36213632
class BracketAB(_Bracket):
36223633
"""
3623-
An arrow with a bracket(]) at both ends.
3634+
An arrow with a bracket(]) at both ends.
36243635
"""
36253636

36263637
def __init__(self,
36273638
widthA=1., lengthA=0.2, angleA=None,
36283639
widthB=1., lengthB=0.2, angleB=None):
36293640
"""
3630-
*widthA*
3631-
width of the bracket
3641+
Parameters
3642+
----------
3643+
widthA : float, optional, default : 1.0
3644+
Width of the bracket
36323645
3633-
*lengthA*
3634-
length of the bracket
3646+
lengthA : float, optional, default : 0.2
3647+
Length of the bracket
36353648
3636-
*angleA*
3637-
angle between the bracket and the line
3649+
angleA : float, optional, default : None
3650+
Angle between the bracket and the line
36383651
3639-
*widthB*
3640-
width of the bracket
3652+
widthB : float, optional, default : 1.0
3653+
Width of the bracket
36413654
3642-
*lengthB*
3643-
length of the bracket
3655+
lengthB : float, optional, default : 0.2
3656+
Length of the bracket
36443657
3645-
*angleB*
3646-
angle between the bracket and the line
3658+
angleB : float, optional, default : None
3659+
Angle between the bracket and the line
36473660
"""
36483661

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

36613674
def __init__(self, widthA=1., lengthA=0.2, angleA=None):
36623675
"""
3663-
*widthA*
3664-
width of the bracket
3676+
Parameters
3677+
----------
3678+
widthA : float, optional, default : 1.0
3679+
Width of the bracket
36653680
3666-
*lengthA*
3667-
length of the bracket
3681+
lengthA : float, optional, default : 0.2
3682+
Length of the bracket
36683683
3669-
*angleA*
3670-
angle between the bracket and the line
3684+
angleA : float, optional, default : None
3685+
Angle between the bracket and the line
36713686
"""
36723687

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

36853700
def __init__(self, widthB=1., lengthB=0.2, angleB=None):
36863701
"""
3687-
*widthB*
3688-
width of the bracket
3702+
Parameters
3703+
----------
3704+
widthB : float, optional, default : 1.0
3705+
Width of the bracket
36893706
3690-
*lengthB*
3691-
length of the bracket
3707+
lengthB : float, optional, default : 0.2
3708+
Length of the bracket
36923709
3693-
*angleB*
3694-
angle between the bracket and the line
3710+
angleB : float, optional, default : None
3711+
Angle between the bracket and the line
36953712
"""
36963713

36973714
super(ArrowStyle.BracketB, self).__init__(None, True,
@@ -3710,23 +3727,19 @@ def __init__(self,
37103727
widthA=1., angleA=None,
37113728
widthB=1., angleB=None):
37123729
"""
3713-
*widthA*
3714-
width of the bracket
3715-
3716-
*lengthA*
3717-
length of the bracket
3718-
3719-
*angleA*
3720-
angle between the bracket and the line
3730+
Parameters
3731+
----------
3732+
widthA : float, optional, default : 1.0
3733+
Width of the bracket
37213734
3722-
*widthB*
3723-
width of the bracket
3735+
angleA : float, optional, default : None
3736+
Angle between the bracket and the line
37243737
3725-
*lengthB*
3726-
length of the bracket
3738+
widthB : float, optional, default : 1.0
3739+
Width of the bracket
37273740
3728-
*angleB*
3729-
angle between the bracket and the line
3741+
angleB : float, optional, default : None
3742+
Angle between the bracket and the line
37303743
"""
37313744

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

37433756
def __init__(self, head_length=.5, head_width=.5, tail_width=.2):
37443757
"""
3745-
*head_length*
3746-
length of the arrow head
3747-
3748-
*head_with*
3749-
width of the arrow head
3758+
Parameters
3759+
----------
3760+
head_length : float, optional, default : 0.5
3761+
Length of the arrow head
37503762
3751-
*tail_width*
3752-
width of the arrow tail
3763+
head_width : float, optional, default : 0.5
3764+
Width of the arrow head
37533765
3766+
tail_width : float, optional, default : 0.2
3767+
Width of the arrow tail
37543768
"""
37553769

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

38293843
def __init__(self, head_length=.4, head_width=.4, tail_width=.4):
38303844
"""
3831-
*head_length*
3832-
length of the arrow head
3833-
3834-
*head_with*
3835-
width of the arrow head
3845+
Parameters
3846+
----------
3847+
head_length : float, optional, default : 0.4
3848+
Length of the arrow head
38363849
3837-
*tail_width*
3838-
width of the arrow tail
3850+
head_width : float, optional, default : 0.4
3851+
Width of the arrow head
38393852
3853+
tail_width : float, optional, default : 0.4
3854+
Width of the arrow tail
38403855
"""
38413856

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

39343948
def __init__(self, tail_width=.3, shrink_factor=0.5):
39353949
"""
3936-
*tail_width*
3937-
width of the tail
3950+
Parameters
3951+
----------
3952+
tail_width : float, optional, default : 0.3
3953+
Width of the tail
39383954
3939-
*shrink_factor*
3940-
fraction of the arrow width at the middle point
3955+
shrink_factor : float, optional, default : 0.5
3956+
Fraction of the arrow width at the middle point
39413957
"""
39423958

39433959
self.tail_width = tail_width

0 commit comments

Comments
 (0)