@@ -3308,7 +3308,9 @@ def transmute(self, path, mutation_size, linewidth):
3308
3308
x0 , y0 = path .vertices [0 ]
3309
3309
x1 , y1 = path .vertices [1 ]
3310
3310
3311
- if self .beginarrow :
3311
+ # If there is no room for an arrow and a line, then skip the arrow
3312
+ hasBeginArrow = self .beginArrow and not ((x0 == x1 ) and (y0 == y1 ))
3313
+ if hasBeginArrow :
3312
3314
verticesA , codesA , ddxA , ddyA = \
3313
3315
self ._get_arrow_wedge (x1 , y1 , x0 , y0 ,
3314
3316
head_dist , cos_t , sin_t ,
@@ -3321,7 +3323,9 @@ def transmute(self, path, mutation_size, linewidth):
3321
3323
x2 , y2 = path .vertices [- 2 ]
3322
3324
x3 , y3 = path .vertices [- 1 ]
3323
3325
3324
- if self .endarrow :
3326
+ # If there is no room for an arrow and a line, then skip the arrow
3327
+ hasEndArrow = self .endArrow and not ((x2 == x3 ) and (y2 == y3 ))
3328
+ if hasEndArrow :
3325
3329
verticesB , codesB , ddxB , ddyB = \
3326
3330
self ._get_arrow_wedge (x2 , y2 , x3 , y3 ,
3327
3331
head_dist , cos_t , sin_t ,
@@ -3338,7 +3342,7 @@ def transmute(self, path, mutation_size, linewidth):
3338
3342
path .codes )]
3339
3343
_fillable = [False ]
3340
3344
3341
- if self . beginarrow :
3345
+ if hasBeginArrow :
3342
3346
if self .fillbegin :
3343
3347
p = np .concatenate ([verticesA , [verticesA [0 ],
3344
3348
verticesA [0 ]], ])
@@ -3349,7 +3353,7 @@ def transmute(self, path, mutation_size, linewidth):
3349
3353
_path .append (Path (verticesA , codesA ))
3350
3354
_fillable .append (False )
3351
3355
3352
- if self . endarrow :
3356
+ if hasEndArrow :
3353
3357
if self .fillend :
3354
3358
_fillable .append (True )
3355
3359
p = np .concatenate ([verticesB , [verticesB [0 ],
0 commit comments