Skip to content

Arrow tip erroneously includes dashes #17284

@asteppke

Description

@asteppke

Bug report

The linestyle of the arrowhead seems not correct in matplotlib 3.1.3 when using dashed lines. Is there something that can be done to workaround or fix this?

Code for reproduction

from matplotlib import pyplot as plt
fig, ax = plt.subplots(figsize=(3,2))

ax.plot([-0.5, 0], [183, 184], linestyle='--', linewidth=1.0)
ax.annotate("", (-0.22,184), xytext=(-0.175,184.1), 
            arrowprops=dict(arrowstyle="->", color='black', linestyle='--', linewidth=1.0,),
           )    
ax.set_xlim((-0.25, -0.15))
ax.set_ylim((180, 185))

which shows the dashed lines in the arrow head/tip which looks like the arrow is broken and changes depending on its length and position:

image

(I don't know why the linestyles regarding spacing are different, but this is probably just a rc parameter setting.)

Matplotlib version

  • Operating system: Windows 10
  • Matplotlib version: 3.1.3
  • Matplotlib backend: all

Related
This looks a little bit like #9579 but I don't know if the same codepath is relevant here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuestopic: arrow

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions