8000 Shorten bracket arrowstyle docs. · matplotlib/matplotlib@251d99b · GitHub
[go: up one dir, main page]

Skip to content

Commit 251d99b

Browse files
committed
Shorten bracket arrowstyle docs.
We can still support None angles as synonym to zero, but don't really need to document them.
1 parent d45060c commit 251d99b

File tree

1 file changed

+16
-48
lines changed

1 file changed

+16
-48
lines changed

lib/matplotlib/patches.py

Lines changed: 16 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3215,7 +3215,7 @@ class _Bracket(_Base):
32153215
def __init__(self, bracketA=None, bracketB=None,
32163216
widthA=1., widthB=1.,
32173217
lengthA=0.2, lengthB=0.2,
3218-
angleA=None, angleB=None,
3218+
angleA=0, angleB=0,
32193219
scaleA=None, scaleB=None):
32203220
self.bracketA, self.bracketB = bracketA, bracketB
32213221
self.widthA, self.widthB = widthA, widthB
@@ -3241,7 +3241,7 @@ def _get_bracket(self, x0, y0,
32413241
Path.LINETO,
32423242
Path.LINETO]
32433243

3244-
if angle is not None:
3244+
if angle:
32453245
trans = transforms.Affine2D().rotate_deg_around(x0, y0, angle)
32463246
vertices_arrow = trans.transform(vertices_arrow)
32473247

@@ -3298,32 +3298,17 @@ class BracketAB(_Bracket):
32983298
"""An arrow with outward square brackets at both ends."""
32993299

33003300
def __init__(self,
3301-
widthA=1., lengthA=0.2, angleA=None,
3302-
widthB=1., lengthB=0.2, angleB=None):
3301+
widthA=1., lengthA=0.2, angleA=0,
3302+
widthB=1., lengthB=0.2, angleB=0):
33033303
"""
33043304
Parameters
33053305
----------
3306-
widthA : float, default: 1.0
3306+
widthA, widthB : float, default: 1.0
33073307
Width of the bracket.
3308-
3309-
lengthA : float, default: 0.2
3308+
lengthA, lengthB : float, default: 0.2
33103309
Length of the bracket.
3311-
3312-
angleA : float, default: None
3313-
Angle, in degrees, between the bracket and the line. Zero is
3314-
perpendicular to the line, and positive measures
3315-
counterclockwise.
3316-
3317-
widthB : float, default: 1.0
3318-
Width of the bracket.
3319-
3320-
lengthB : float, default: 0.2
3321-
Length of the bracket.
3322-
3323-
angleB : float, default: None
3324-
Angle, in degrees, between the bracket and the line. Zero is
3325-
perpendicular to the line, and positive measures
3326-
counterclockwise.
3310+
angleA, angleB : float, default: 0 degrees
3311+
Angle between the bracket and the line (counterclockwise).
33273312
"""
33283313
super().__init__(True, True,
33293314
widthA=widthA, lengthA=lengthA, angleA=angleA,
@@ -3333,18 +3318,16 @@ def __init__(self,
33333318
class BracketA(_Bracket):
33343319
"""An arrow with an outward square bracket at its start."""
33353320

3336-
def __init__(self, widthA=1., lengthA=0.2, angleA=None):
3321+
def __init__(self, widthA=1., lengthA=0.2, angleA=0):
33373322
"""
33383323
Parameters
33393324
----------
33403325
widthA : float, default: 1.0
33413326
Width of the bracket.
3342-
33433327
lengthA : float, default: 0.2
33443328
Length of the bracket.
3345-
3346-
angleA : float, default: None
3347-
Angle between the bracket and the line.
3329+
angleA : float, default: 0 degrees
3330+
Angle between the bracket and the line (counterclockwise).
33483331
"""
33493332
super().__init__(True, None,
33503333
widthA=widthA, lengthA=lengthA, angleA=angleA)
@@ -3359,14 +3342,10 @@ def __init__(self, widthB=1., lengthB=0.2, angleB=None):
33593342
----------
33603343
widthB : float, default: 1.0
33613344
Width of the bracket.
3362-
33633345
lengthB : float, default: 0.2
33643346
Length of the bracket.
3365-
3366-
angleB : float, default: None
3367-
Angle, in degrees, between the bracket and the line. Zero is
3368-
perpendicular to the line, and positive measures
3369-
counterclockwise.
3347+
angleB : float, default: 0 degrees
3348+
Angle between the bracket and the line (counterclockwise).
33703349
"""
33713350
super().__init__(None, True,
33723351
widthB=widthB, lengthB=lengthB, angleB=angleB)
@@ -3381,21 +3360,10 @@ def __init__(self,
33813360
"""
33823361
Parameters
33833362
----------
3384-
widthA : float, default: 1.0
3363+
widthA, widthB : float, default: 1.0
33853364
Width of the bracket.
3386-
3387-
angleA : float, default: None
3388-
Angle, in degrees, between the bracket and the line. Zero is
3389-
perpendicular to the line, and positive measures
3390-
counterclockwise.
3391-
3392-
widthB : float, default: 1.0
3393-
Width of the bracket.
3394-
3395-
angleB : float, default: None
3396-
Angle, in degrees, between the bracket and the line. Zero is
3397-
perpendicular to the line, and positive measures
3398-
counterclockwise.
3365+
angleA, angleB : float, default: 0 degrees
3366+
Angle between the bracket and the line (counterclockwise).
33993367
"""
34003368
super().__init__(True, True,
34013369
widthA=widthA, lengthA=0, angleA=angleA,

0 commit comments

Comments
 (0)
0