【发布时间】:2020-11-02 23:44:40
【问题描述】:
目前,情节给了我这个:
使用:
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
# setup north polar stereographic basemap.
# The longitude lon_0 is at 6-o'clock, and the
# latitude circle boundinglat is tangent to the edge
# of the map at lon_0. Default value of lat_ts
# (latitude of true scale) is pole.
m = Basemap(projection='npstere',boundinglat=55,lon_0=-47,resolution='l') #llcrnrlon=-55.,llcrnrlat=60.,urcrnrlon=-40.,urcrnrlat=65.,
#x,y = m(lon2,lat2)
m.drawcoastlines()
m.fillcontinents(color='white',lake_color='aqua')
# draw parallels and meridians.
m.drawparallels(np.arange(-80.,81.,20.))
m.drawmeridians(np.arange(-180.,181.,20.))
m.drawmapboundary(fill_color='aqua')
# draw tissot's indicatrix to show distortion.
ax = plt.gca()
for y in np.linspace(m.ymax/20,19*m.ymax/20,10):
for x in np.linspace(m.xmax/20,19*m.xmax/20,10):
lon, lat = m(x,y,inverse=True)
poly = m.tissot(lon,lat,2.5,100,\
facecolor='green',zorder=10,alpha=0.5)
plt.title("North Polar Stereographic Projection")
plt.show()
我希望能够放大格陵兰岛的一部分,换句话说,能够将地图的边界角设置为特定的纬度和经度。这可能吗?当前投影太小了。
我想要类似这段代码使用 Lambert Conformal Conic 给我的东西
m = Basemap(llcrnrlon=-60.,llcrnrlat=60.,urcrnrlon=-40.,urcrnrlat=70.,
projection='lcc',lat_1=20.,lat_2=40.,lon_0=-60.,
resolution ='l',area_thresh=1000.)
m.drawcoastlines()
m.drawcountries()
m.drawmapboundary(fill_color='#99ffff')
m.fillcontinents(color='#cc9966',lake_color='#99ffff')
m.drawparallels(np.arange(10,70,20),labels=[1,1,0,0])
m.drawmeridians(np.arange(-100,0,20),labels=[0,0,0,1])
plt.title('ICESAT2 Tracks in Greenland')
plt.show()
这给出了:
当然是在北极立体投影中。有什么想法吗?
【问题讨论】:
标签: python python-3.x matplotlib matplotlib-basemap polar-coordinates