Issue
I tried to draw an arrow between to coordinates but couldn't succeed.Let's say i got two points.Like coord1=(34,56) and coord2=(83,51) i need to draw an arrow between coord1 to coord2 but arrow must me angled.If i use just pyplot marker style ">" ,every arrow looks same, not angled. Then i find arrow guide from matplotlib here https://matplotlib.org/stable/gallery/shapes_and_collections/arrow_guide.html I change the numbers like what i want but i didn't work.Why?Or anyone knows how to draw an arrow with coordinate system.Thanks.
Solution
You can use annotate
to draw an arrow:
fig,ax = plt.subplots()
ax.annotate('', xytext=(34, 56), xy=(83, 51), arrowprops=dict(arrowstyle='->'))
ax.set(xlim=(30, 90), ylim=(50, 60))
Answered By - Stef
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.