def main2():
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
# llcrnrlat,llcrnrlon,urcrnrlat,urcrnrlon
# are the lat/lon values of the lower left and upper right corners
# of the map.
# resolution = 'i' means use intermediate resolution coastlines.
# lon_0, lat_0 are the central longitude and latitude of the projection.
m = Basemap(llcrnrlon=9.5, llcrnrlat=63.2,
urcrnrlon=10.9, urcrnrlat=64.,
resolution='i', projection='tmerc',
lon_0=10.7, lat_0=63.4)
# can get the identical map this way (by specifying width and
# height instead of lat/lon corners)
# m = Basemap(width=894887,height=1116766,\
# resolution='i',projection='tmerc',lon_0=-4.36,lat_0=54.7)
m.drawcoastlines()
m.fillcontinents(color='coral', lake_color='aqua')
# m.drawparallels(np.arange(-40, 61., 2.))
# m.drawmeridians(np.arange(-20., 21., 2.))
m.drawmapboundary(fill_color='aqua')
plt.title("Transverse Mercator Projection")
plt.show()
评论列表
文章目录