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