Skip to content

Instantly share code, notes, and snippets.

@tacaswell
Created July 25, 2014 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tacaswell/a11a149d6b7557966f0c to your computer and use it in GitHub Desktop.
Save tacaswell/a11a149d6b7557966f0c to your computer and use it in GitHub Desktop.
# 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