- 积分
- 64
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2017-8-25
- 最后登录
- 1970-1-1
|
发表于 2020-3-9 14:37:54
|
显示全部楼层
basemap 中用 projection = 'lcc', 即可,示例代码如下:- plt.figure(figsize=((16, 9)))
- map = Basemap(llcrnrlon = milo, # ll 左下,ur 右上
- llcrnrlat = mila,
- urcrnrlon = malo,
- urcrnrlat = mala,
- projection = 'lcc',
- lat_0 = (mala+mila)/2,
- lon_0 = (malo+milo)/2)
- map.drawcoastlines(color = 'grey')
- # shp_info = map.readshapefile("./ShapeFile/中国行政区_包含南海九段线",'states',drawbounds=True, color = 'grey')
- # 绘制中国省界https://blog.csdn.net/ouening/article/details/55227364
- nx = prec.shape[1]; ny = prec.shape[0]
- Llats, Llons = map.makegrid(nx, ny)
- x, y = map(Llats, Llons)
- # https://www.jianshu.com/p/e36d1b4c455a
- # 经纬线空间均匀
- cmprec=('#F7F7F7', '#A5F38D', '#3DB93F', '#63B8F9', '#0000FE', '#F305EE', '#810040')
- cs = map.contourf(x, y, prec, np.array([2, 10, 25, 50, 100, 200]), colors=cmprec, extend='both')
- map.colorbar(cs, location='right', label='mm')
- map.drawparallels(np.arange(18, 55, 8), labels=[1,0,0,0], linewidth=0.5, fontsize=12)
- map.drawmeridians(np.arange(72, 137, 8), labels=[0,0,0,1], linewidth=0.5, fontsize=12)
- plt.title(fname[-12:-8]+'.'+fname[-8:-6]+'.'+fname[-6:-4]+' Preciption')
- plt.show()
- # plt.savefig(fname[-12:-4]+'Preciption'+'.png')
- plt.close('all')
- # return True
复制代码
[img]![]()[/img]
附上 basemap 所有投影命令
- |First Header|Second Header|Second Header|
- |------------ |------------- |------------- |
- cyl|Cylindrical Equidistant|圆柱等距
- merc|Mercator| 墨卡托
- tmerc|Transverse Mercator|横轴墨卡托投影
- omerc|Oblique Mercator| 倾斜麦克托投影
- mill|Miller Cylindrical| 米勒图柱投影
- gall|Gall Stereographic Cylindrical| Gall立体圆柱
- cea|Cylindrical Equal Area| 等面积圆柱体投影法
- lcc|Lambert Conformal| 兰勃特投影
- laea|Lambert Azimuthal Equal Area| 兰伯特正方位等面积投影
- nplaea|North-Polar Lambert Azimuthal| 北极兰伯特方位
- splaea|South-Polar Lambert Azimuthal| 南极兰伯特方位
- eqdc|Equidistant Conic| 地图投影
- aeqd|Azimuthal Equidistant| 等距方位投影
- npaeqd|North-Polar Azimuthal Equidistant| 北极等距方位投影
- spaeqd|South-Polar Azimuthal Equidistant| 南极等距方位投影
- aea|Albers Equal Area| 亚尔勃斯等积投影
- stere|Stereographic| 平射投影
- npstere|North-Polar Stereographic| 北极平射投影
- spstere|South-Polar Stereographic| 南极平射投影
- cass|Cassini-Soldner|
- poly|Polyconic| 多锥体投影
- ortho|Orthographic| 正交投影
- geos|Geostationary| 对地静止投影
- nsper|Near-Sided Perspective|
- sinu|Sinusoidal| 正弦投影
- moll|Mollweide| 摩尔维特投影
- hammer|Hammer|
- robin|Robinson|
- kav7|Kavrayskiy VII|
- eck4|Eckert IV|
- vandg|van der Grinten|
- mbtfpq|McBryde-Thomas Flat-Polar Quartic|
- gnom|Gnomonic|
- rotpole|Rotated Pole|
复制代码
|
|