8000 Merge pull request #20106 from anntzer/bracketdoc · matplotlib/matplotlib@95b4527 · GitHub
[go: up one dir, main page]

Skip to content

Commit 95b4527

Browse files
authored
Merge pull request #20106 from anntzer/bracketdoc
Shorten bracket arrowstyle docs.
2 parents 75d2b1c + 44fff05 commit 95b4527

File tree

1 file changed

+20
-48
lines changed

1 file changed

+20
-48
lines changed

lib/matplotlib/patches.py

Lines changed: 20 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3470,7 +3470,7 @@ class _Bracket(_Base):
34703470
def __init__(self, bracketA=None, bracketB=None,
34713471
widthA=1., widthB=1.,
34723472
lengthA=0.2, lengthB=0.2,
3473-
angleA=None, angleB=None,
3473+
angleA=0, angleB=0,
34743474
scaleA=None, scaleB=None):
34753475
self.bracketA, self.bracketB = bracketA, bracketB
34763476
self.widthA, self.widthB = widthA, widthB
@@ -3496,7 +3496,7 @@ def _get_bracket(self, x0, y0,
34963496
Path.LINETO,
34973497
Path.LINETO]
34983498

3499-
if angle is not None:
3499+
if angle:
35003500
trans = transforms.Affine2D().rotate_deg_around(x0, y0, angle)
35013501
vertices_arrow = trans.transform(vertices_arrow)
35023502

@@ -3553,32 +3553,18 @@ class BracketAB(_Bracket):
35533553
"""An arrow with outward square brackets at both ends."""
35543554

35553555
def __init__(self,
3556-
widthA=1., lengthA=0.2, angleA=None,
3557-
widthB=1., lengthB=0.2, angleB=None):
3556+
widthA=1., lengthA=0.2, angleA=0,
3557+
widthB=1., lengthB=0.2, angleB=0):
35583558
"""
35593559
Parameters
35603560
----------
3561-
widthA : float, default: 1.0
3561+
widthA, widthB : float, default: 1.0
35623562
Width of the bracket.
3563-
3564-
lengthA : float, default: 0.2
3563+
lengthA, lengthB : float, default: 0.2
35653564
Length of the bracket.
3566-
3567-
angleA : float, default: None
3568-
Angle, in degrees, between the bracket and the line. Zero is
3569-
perpendicular to the line, and positive measures
3570-
counterclockwise.
3571-
3572-
widthB : float, default: 1.0
3573-
Width of the bracket.
3574-
3575-
lengthB : float, default: 0.2
3576-
Length of the bracket.
3577-
3578-
angleB : float, default: None
3579-
Angle, in degrees, between the bracket and the line. Zero is
3580-
perpendicular to the line, and positive measures
3581-
counterclockwise.
3565+
angleA, angleB : float, default: 0 degrees
3566+
Orientation of the bracket, as a counterclockwise angle.
3567+
0 degrees means perpendicular to the line.
35823568
"""
35833569
super().__init__(True, True,
35843570
widthA=widthA, lengthA=lengthA, angleA=angleA,
@@ -3588,18 +3574,17 @@ def __init__(self,
35883574
class BracketA(_Bracket):
35893575
"""An arrow with an outward square bracket at its start."""
35903576

3591-
def __init__(self, widthA=1., lengthA=0.2, angleA=None):
3577+
def __init__(self, widthA=1., lengthA=0.2, angleA=0):
35923578
"""
35933579
Parameters
35943580
----------
35953581
widthA : float, default: 1.0
35963582
Width of the bracket.
3597-
35983583
lengthA : float, default: 0.2
35993584
Length of the bracket.
3600-
3601-
angleA : float, default: None
3602-
Angle between the bracket and the line.
3585+
angleA : float, default: 0 degrees
3586+
Orientation of the bracket, as a counterclockwise angle.
3587+
0 degrees means perpendicular to the line.
36033588
"""
36043589
super().__init__(True, None,
36053590
widthA=widthA, lengthA=lengthA, angleA=angleA)
@@ -3614,14 +3599,11 @@ def __init__(self, widthB=1., lengthB=0.2, angleB=None):
36143599
----------
36153600
widthB : float, default: 1.0
36163601
Width of the bracket.
3617-
36183602
lengthB : float, default: 0.2
36193603
Length of the bracket.
3620-
3621-
angleB : float, default: None
3622-
Angle, in degrees, between the bracket and the line. Zero is
3623-
perpendicular to the line, and positive measures
3624-
counterclockwise.
3604+
angleB : float, default: 0 degrees
3605+
Orientation of the bracket, as a counterclockwise angle.
3606+
0 degrees means perpendicular to the line.
36253607
"""
36263608
super().__init__(None, True,
36273609
widthB=widthB, lengthB=lengthB, angleB=angleB)
@@ -3636,21 +3618,11 @@ def __init__(self,
36363618
"""
36373619
Parameters
36383620
----------
3639-
widthA : float, default: 1.0
3621+
widthA, widthB : float, default: 1.0
36403622
Width of the bracket.
3641-
3642-
angleA : float, default: None
3643-
Angle, in degrees, between the bracket and the line. Zero is
3644-
perpendicular to the line, and positive measures
3645-
counterclockwise.
3646-
3647-
widthB : float, default: 1.0
3648-
Width of the bracket.
3649-
3650-
angleB : float, default: None
3651-
Angle, in degrees, between the bracket and the line. Zero is
3652-
perpendicular to the line, and positive measures
3653-
counterclockwise.
3623+
angleA, angleB : float, default: 0 degrees
3624+
Orientation of the bracket, as a counterclockwise angle.
3625+
0 degrees means perpendicular to the line.
36543626
"""
36553627
super().__init__(True, True,
36563628
widthA=widthA, lengthA=0, angleA=angleA,

0 commit comments

Comments
 (0)
0