- 积分
- 1210
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-7-2
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
有京津冀地区的shapefile文件,想只做出京津冀地区的气温变化图,
想请教坛友三个问题
1.如何只做京津冀区域的图像,而其他区域都是白色?
2.图中白色的部分太多,和colorbar应该有关系,但是我尝试用opts@cnFillPalette=“BlWhRe”等调整过几次,都出现了color index (246) exceeds size of palette, defaulting to foreground color for entry (101)类似的警告,然后图上大面积黑色,该如何设置这个colorbar才能使只有0是白色,其他都有颜色呢?
已有代码如下:
begin
;
;数据加载
;
dir1="/data1/Jingjinji2000-201001/" ;;;;;;;;;;;a1 前一个年份
files1= "wrfout2_2000_01"
a1=addfiles(dir1 + files1 + ".nc", "r")
dir2="/data1/Jingjinji2010-201001/" ;;;;;;;;;;;a2 后一个年份
files2= "wrfout2_2010_01"
a2=addfiles(dir2 + files2 + ".nc", "r")
b=addfile("./wrfout_d02_2010-01-01_00:00:00.nc", "r")
type="pdf"
wks=gsn_open_wks(type, "ave_diff_geo2000-2010_201001(test_color)")
;
;地图参数设置
;
res=True
res@cnFillMode="RasterFill"
pltres=True
mpres=True
;mpres@mpFillOn = True
mpres@mpDataBaseVersion = "Ncarg4_1"
mpres@mpDataSetName = "Earth..4"
mpres@mpNationalLineColor = "Black"
mpres@mpUSStateLineColor = "Black"
mpres@mpOutlineBoundarySets = "AllBoundaries"
;
;两期数据做差
;
xhr1 =wrf_user_getvar(a1, "T2", -1)
tc1=dim_avg_n(xhr1, 0)
tc1=tc1-273.16
tc1@description="Surface Temperature"
tc1@units="C"
xhr2 =wrf_user_getvar(a2, "T2", -1)
tc2=dim_avg_n(xhr2, 0)
tc2=tc2-273.16
tc2@description="Surface Temperature"
tc2@units="C"
tc=tc2-tc1
;tc=tc*2
tc@description="Surface Temperature"
tc@units="C"
;
;绘图设置
;
opts=res
opts@cnFillOn=True
;opts@cnFillPalette="BlWhRe"
opts@ContourParameters=(/-1.,1.,0.02/)
opts@gsnSpreadColorEnd=-10
contour_tc=wrf_contour(b, wks, tc, opts) ;添加的是多个文件,b该如何添加
delete(opts)
plot=wrf_map_overlays(b, wks, (/contour_tc/), pltres, mpres)
end
|
|