Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# this bit of code makes sure that the head stays a fixed size in terms of
# axes fractions. To tune this size change `head_size`
head_size = 30
# to tun the ratio between the head size and the shaft, change `ascale`
ascale = .2
# tunes how 'pinched' the arrow head is, < 1 and the bottom will be indented
# > 1 the arrow will be a distorted diamond
pinched = .7
# tunes how wide the arrow head is relative to the length of the arrow head
# <1 -> pointyer
# >1 -> broader
aspect = .5
# don't mess with these!
width = .0005 * ascale
head = head_size / ascale
# make the quiver plot with triangular heads
ax.quiver(X,Y,U,V,angles='xy',scale_units='xy',scale=2, minshaft=.01, width=width,
headlength=head, headaxislength=pinched * head, headwidth=head*aspect)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment