Hi,
I'm trying to produce a map with 12 locations marked on it and straight lines plotted between each point and all other points on the map. I have the map with the locations ok but am having trouble getting the lines. My code is below anyone know how to do this??
Thanks
D
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import matplotlib.lines as lines
import numpy as np
m = Basemap(llcrnrlon=-11.5,llcrnrlat=51.0,urcrnrlon=-4.5,urcrnrlat=56.0,
resolution='i',projection='cass',lon_0=-4.36,lat_0=54.7)
lats = [53.5519317,53.8758499, 54.2894659, 55.2333142, 54.9846137,54.7064869, 51.5296651, 51.5536226, 51.7653115, 52.1625237, 52.5809163, 52.9393892]
lons = [-9.9413447, -9.9621948, -8.9583439, -7.6770179, -8.3771698, -8.7406732, -8.9529546, -9.7907148, -10.1531573, -10.4099873, -9.8456417, -9.4344939]
x, y = m(lons, lats)
for i in range(len(lons)):
for j in range(len(lons)):
if i == j: continue
m.plot([x[i],y[i]],[x[j],y[j]],'k')
m.plot(x, y, 'bD', markersize=10)
m.drawcoastlines()
#m.drawmapboundary()
#plt.savefig('/media/A677-86E0/dot_size'+str(i)+'.png')
plt.show()