@@ -376,7 +376,7 @@ def set_hatch(self, hatch):
376
376
Hatching is supported in the PostScript, PDF, SVG and Agg
377
377
backends only.
378
378
379
- ACCEPTS: [ '/' | '\\ \\ ' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ]
379
+ ACCEPTS: ['/' | '\\ \\ ' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*']
380
380
"""
381
381
self ._hatch = hatch
382
382
@@ -872,7 +872,6 @@ def __init__(self, center, r, theta1, theta2, width=None, **kwargs):
872
872
self .theta1 , self .theta2 = theta1 , theta2
873
873
874
874
# Inner and outer rings are connected unless the annulus is complete
875
- delta = theta2 - theta1
876
875
if abs ((theta2 - theta1 ) - 360 ) <= 1e-12 :
877
876
theta1 , theta2 = 0 , 360
878
877
connector = Path .MOVETO
@@ -956,8 +955,8 @@ def __str__(self):
956
955
return "FancyArrow()"
957
956
958
957
@docstring .dedent_interpd
959
- def __init__ (self , x , y , dx , dy , width = 0.001 , length_includes_head = False , \
960
- head_width = None , head_length = None , shape = 'full' , overhang = 0 , \
958
+ def __init__ (self , x , y , dx , dy , width = 0.001 , length_includes_head = False ,
959
+ head_width = None , head_length = None , shape = 'full' , overhang = 0 ,
961
960
head_starts_at_zero = False , ** kwargs ):
962
961
"""
963
962
Constructor arguments
@@ -1493,7 +1492,7 @@ def iter_circle_intersect_on_line_seg(x0, y0, x1, y1):
1493
1492
path_original = self ._path
1494
1493
for theta in thetas :
1495
1494
if inside :
1496
- _path = Path .arc (last_theta , theta , 8 )
1495
+ Path .arc (last_theta , theta , 8 )
1497
1496
Patch .draw (self , renderer )
1498
1497
inside = False
1499
1498
else :
@@ -1600,6 +1599,7 @@ def _pprint_styles(_styles, leadingspace=2):
1600
1599
(stylename : styleclass), return a formatted string listing all the
1601
1600
styles. Used to update the documentation.
1602
1601
"""
1602
+ # FIXME pad isn't used, which means leadingspace is not use.
1603
1603
if leadingspace :
1604
1604
pad = ' ' * leadingspace
1605
1605
else :
@@ -2143,7 +2143,7 @@ def transmute(self, x0, y0, width, height, mutation_size):
2143
2143
width , height ,
2144
2144
mutation_size )
2145
2145
2146
- cp = [Path .MOVETO ] + ([Path .CURVE3 , Path .CURVE3 ] \
2146
+ cp = [Path .MOVETO ] + ([Path .CURVE3 , Path .CURVE3 ]
2147
2147
* ((len (saw_vertices ) - 1 ) // 2 ))
2148
2148
path = Path (saw_vertices , cp )
2149
2149
@@ -2244,7 +2244,7 @@ def set_boxstyle(self, boxstyle=None, **kw):
2244
2244
ACCEPTS: %(AvailableBoxstyles)s
2245
2245
2246
2246
"""
2247
- if boxstyle == None :
2247
+ if boxstyle is None :
2248
2248
return BoxStyle .pprint_styles ()
2249
2249
2250
2250
if isinstance (boxstyle , BoxStyle ._Base ):
@@ -2847,8 +2847,8 @@ def _point_along_a_line(x0, y0, x1, y1, d):
2847
2847
distance from (x0, y0) is d.
2848
2848
"""
2849
2849
dx , dy = x0 - x1 , y0 - y1
2850
- ff = d / (dx * dx + dy * dy )** .5
2851
- x2 , y2 = x0 - ff * dx , y0 - ff * dy
2850
+ ff = d / (dx * dx + dy * dy ) ** .5
2851
+ x2 , y2 = x0 - ff * dx , y0 - ff * dy
2852
2852
2853
2853
return x2 , y2
2854
2854
@@ -3122,7 +3122,7 @@ class Curve(_Curve):
3122
3122
"""
3123
3123
3124
3124
def __init__ (self ):
3125
- super (ArrowStyle .Curve , self ).__init__ ( \
3125
+ super (ArrowStyle .Curve , self ).__init__ (
3126
3126
beginarrow = False , endarrow = False )
3127
3127
3128
3128
_style_list ["-" ] = Curve
@@ -3181,7 +3181,7 @@ def __init__(self, head_length=.4, head_width=.2):
3181
3181
width of the arrow head
3182
3182
"""
3183
3183
3184
- super (ArrowStyle .CurveAB , self ).__init__ ( \
3184
+ super (ArrowStyle .CurveAB , self ).__init__ (
3185
3185
beginarrow = True , endarrow = True ,
3186
3186
head_length = head_length , head_width = head_width )
3187
3187
@@ -3201,7 +3201,7 @@ def __init__(self, head_length=.4, head_width=.2):
3201
3201
width of the arrow head
3202
3202
"""
3203
3203
3204
- super (ArrowStyle .CurveFilledA , self ).__init__ ( \
3204
+ super (ArrowStyle .CurveFilledA , self ).__init__ (
3205
3205
beginarrow = True , endarrow = False ,
3206
3206
fillbegin = True , fillend = False ,
3207
3207
head_length = head_length , head_width = head_width )
@@ -3222,7 +3222,7 @@ def __init__(self, head_length=.4, head_width=.2):
3222
3222
width of the arrow head
3223
3223
"""
3224
3224
3225
- super (ArrowStyle .CurveFilledB , self ).__init__ ( \
3225
+ super (ArrowStyle .CurveFilledB , self ).__init__ (
3226
3226
beginarrow = False , endarrow = True ,
3227
3227
fillbegin = False , fillend = True ,
3228
3228
head_length = head_length , head_width = head_width )
@@ -3244,7 +3244,7 @@ def __init__(self, head_length=.4, head_width=.2):
3244
3244
width of the arrow head
3245
3245
"""
3246
3246
3247
- super (ArrowStyle .CurveFilledAB , self ).__init__ ( \
3247
+ super (ArrowStyle .CurveFilledAB , self ).__init__ (
3248
3248
beginarrow = True , endarrow = True ,
3249
3249
fillbegin = True , fillend = True ,
3250
3250
head_length = head_length , head_width = head_width )
@@ -3358,9 +3358,10 @@ def __init__(self,
3358
3358
angle between the bracket and the line
3359
3359
"""
3360
3360
3361
- super (ArrowStyle .BracketAB , self ).__init__ (True , True , \
3362
- widthA = widthA , lengthA = lengthA , angleA = angleA ,
3363
- widthB = widthB , lengthB = lengthB , angleB = angleB )
3361
+ super (ArrowStyle .BracketAB , self ).__init__ (
3362
+ True , True , widthA = widthA , lengthA = lengthA ,
3363
+ angleA = angleA , widthB = widthB , lengthB = lengthB ,
3364
+ angleB = angleB )
3364
3365
3365
3366
_style_list ["]-[" ] = BracketAB
3366
3367
@@ -3436,8 +3437,8 @@ def __init__(self,
3436
3437
angle between the bracket and the line
3437
3438
"""
3438
3439
3439
- super (ArrowStyle .BarAB , self ).__init__ (True , True , \
3440
- widthA = widthA , lengthA = 0 , angleA = angleA ,
3440
+ super (ArrowStyle .BarAB , self ).__init__ (
3441
+ True , True , widthA = widthA , lengthA = 0 , angleA = angleA ,
3441
3442
widthB = widthB , lengthB = 0 , angleB = angleB )
3442
3443
3443
3444
_style_list ["|-|" ] = BarAB
@@ -3481,23 +3482,24 @@ def transmute(self, path, mutation_size, linewidth):
3481
3482
in_f ,
3482
3483
tolerence = 0.01 )
3483
3484
except NonIntersectingPathException :
3484
- # if this happens, make a straight line of the head_length long.
3485
+ # if this happens, make a straight line of the head_length
3486
+ # long.
3485
3487
x0 , y0 = _point_along_a_line (x2 , y2 , x1 , y1 , head_length )
3486
- x1n , y1n = 0.5 * (x0 + x2 ), 0.5 * (y0 + y2 )
3488
+ x1n , y1n = 0.5 * (x0 + x2 ), 0.5 * (y0 + y2 )
3487
3489
arrow_in = [(x0 , y0 ), (x1n , y1n ), (x2 , y2 )]
3488
3490
arrow_out = None
3489
3491
3490
3492
# head
3491
3493
head_width = self .head_width * mutation_size
3492
3494
head_left , head_right = \
3493
- make_wedged_bezier2 (arrow_in , head_width / 2. ,
3495
+ make_wedged_bezier2 (arrow_in , head_width / 2. ,
3494
3496
wm = .5 )
3495
3497
3496
-
3497
3498
# tail
3498
3499
if arrow_out is not None :
3499
3500
tail_width = self .tail_width * mutation_size
3500
- tail_left , tail_right = get_parallels (arrow_out , tail_width / 2. )
3501
+ tail_left , tail_right = get_parallels (arrow_out ,
3502
+ tail_width / 2. )
3501
3503
3502
3504
#head_right, head_left = head_r, head_l
3503
3505
patch_path = [(Path .MOVETO , tail_right [0 ]),
@@ -3570,9 +3572,10 @@ def transmute(self, path, mutation_size, linewidth):
3570
3572
in_f ,
3571
3573
tolerence = 0.01 )
3572
3574
except NonIntersectingPathException :
3573
- # if this happens, make a straight line of the head_length long.
3575
+ # if this happens, make a straight line of the head_length
3576
+ # long.
3574
3577
x0 , y0 = _point_along_a_line (x2 , y2 , x1 , y1 , head_length )
3575
- x1n , y1n = 0.5 * (x0 + x2 ), 0.5 * (y0 + y2 )
3578
+ x1n , y1n = 0.5 * (x0 + x2 ), 0.5 * (y0 + y2 )
3576
3579
arrow_path = [(x0 , y0 ), (x1n , y1n ), (x2 , y2 )]
3577
3580
path_head = arrow_path
3578
3581
else :
@@ -3836,7 +3839,7 @@ def set_connectionstyle(self, connectionstyle, **kw):
3836
3839
available styles as a list of strings.
3837
3840
"""
3838
3841
3839
- if connectionstyle == None :
3842
+ if connectionstyle is None :
3840
3843
return ConnectionStyle .pprint_styles ()
3841
3844
3842
3845
if isinstance (connectionstyle , ConnectionStyle ._Base ):
@@ -3870,7 +3873,7 @@ def set_arrowstyle(self, arrowstyle=None, **kw):
3870
3873
available box styles as a list of strings.
3871
3874
"""
3872
3875
3873
- if arrowstyle == None :
3876
+ if arrowstyle is None :
3874
3877
return ArrowStyle .pprint_styles ()
3875
3878
3876
3879
if isinstance (arrowstyle , ConnectionStyle ._Base ):
0 commit comments