I have been trying to draw arrows on a Basemap object for quite a while already. I found help for drawing lines on the map, but it seems that the arrowhead just does not want to appear.
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np
map = Basemap(projection='merc', lat_0 = 57, lon_0 = -135,
resolution = 'i', area_thresh = 0.1,
llcrnrlon=-136.25, llcrnrlat=56.0,
urcrnrlon=-134.25, urcrnrlat=58)
map.drawcoastlines()
map.drawcountries()
map.drawmapboundary()
lon = -135.3318
lat = 57.0799
x,y = map(lon, lat)
x2, y2 = map(lon+0.5,lat+0.5)
plt.arrow(x,y,x2-x,y2-y,fc="k", ec="k", linewidth = 4, head_width=10, head_length=10)
plt.show()
As a result I only get: http://i.imgur.com/tB6wi2J.png You can see a little bit of a head, but almost nothing. Am I just to stupid to get the arguments right? I have been fiddling around for quite a while...
EDIT: Yes I was just to stupid to get the arguments right. I put 10000 for head width and length and an arrow was visible.. I think because of basemap it calculates in metres and that threw me off.
I just did not put the arguments right. On the scale used it hat to be at least 10000 head_width and head_length
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With