Menu

[r4312]: / trunk / toolkits / basemap-testing / examples / hires.py  Maximize  Restore  History

Download this file

29 lines (27 with data), 923 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from matplotlib.toolkits.basemap import Basemap
from pylab import *
import time
# create new figure
fig=figure()
# background color will be used for 'wet' areas.
fig.add_axes([0.1,0.1,0.8,0.8],axisbg='aqua')
# create Basemap instance. Use 'high' resolution coastlines.
t1 = time.clock()
m = Basemap(llcrnrlon=-11.,llcrnrlat=49.,urcrnrlon=5.,urcrnrlat=59.,
resolution='h',projection='tmerc',lon_0=-8.,lat_0=0.)
print 'time to create instance with high-res boundaries = ',time.clock()-t1
# draw coastlines and fill continents.
m.drawcoastlines()
m.fillcontinents(color='coral')
# draw political boundaries.
m.drawcountries(linewidth=1)
# draw major rivers.
m.drawrivers(color='b')
# draw parallels
circles = arange(48,65,2).tolist()
m.drawparallels(circles,labels=[1,1,0,0])
# draw meridians
meridians = arange(-12,13,2)
m.drawmeridians(meridians,labels=[0,0,1,1])
title("High-Res British Isles",y=1.075)
show()
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.