MeteoInfoLab脚本示例:加载图片和透明图层

MeteoInfoLab的georead函数提供了读取shape文件、image文件(JPG、PNG等,需要有相应的地理定位文件)文件生成图层的功能(事实上shaperead也是同样的功能,不过函数名太过具体)。对于Polygon图层可以设置其颜色透明度,可以用makecolors函数生成颜色列表,函数中设置参数alpha(255是不透明,0是完全透明)。在contourfm函数中设置edgecolor参数可以绘制颜色区域的边框。

脚本程序:

f = addfile('D:/Temp/GrADS/model.ctl')
ps = f['PS'][0,[10,60],[70,140]]
lrelief = georead('D:/Temp/Map/GLOBALeb3colshade.jpg')
world = georead('D:/Temp/Map/country1.shp')
axesm()
geoshow(lrelief)
geoshow(world)
cols = makecolors(20, alpha=128)
layer = contourfm(ps, colors=cols, edgecolor='gray', order=1)
title('Pressure')
colorbar(layer, aspect=12)

posted on 2015-07-30 18:00  yaqiang  阅读(973)  评论(0编辑  收藏  举报

导航