- 积分
- 653
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-12-2
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我画map分布图,code是从官网上找到的,就是风速叠加在温度分布上的图,原始的文件里经纬度没有代表度数的圈,我加上之后,colorbar却消失了,有人知道这是怎么回事吗?我贴一下画图的部分code:
res = True
res@gsnDraw = False
res@gsnFrame = False
res@gsnMaximize = True
res@tmXTOn = False
res@tmYROn = False
res@gsnLeftString = ""
res@gsnRightString = ""
; res@pmTickMarkDisplayMode = "Always"
;;set map;;
mpres = res
mpres@pmTickMarkDisplayMode = "Always"
mpres@mpDataSetName = "Earth..4"
mpres@mpDataBaseVersion = "Ncarg4_1"
mpres@mpOutlineOn = True
mpres@mpOutlineSpecifiers = (/"China:states","Taiwan"/)
mpres@mpGeophysicalLineThicknessF = 2
mpres@mpNationalLineThicknessF = 2
mpres@mpFillDrawOrder = "PreDraw"
mpres@mpFillOn = True
mpres@mpFillAreaSpecifiers = (/"water", "land" /)
mpres@mpSpecifiedFillColors = (/"deepskyblue2","white"/)
; mpres@mpSpecifiedFillColors = (/100,0/)
mpres@mpMaskAreaSpecifiers = (/"China:states","Taiwan"/)
;;set area;;
mpres@mpMinLatF = 30
mpres@mpMaxLatF = 50
mpres@mpMinLonF = 110
mpres@mpMaxLonF = 130
;;set contour;;
cnres = res
cnres@cnFillDrawOrder = "PreDraw"
cnres@cnFillOn = True
cnres@cnLinesOn = False
cnres@pmLabelBarWidthF = 0.4
cnres@pmLabelBarHeightF = 0.05
cnres@pmLabelBarOrthogonalPosF = 0.1
cnres@lbLabelFontHeightF = 0.01
cnres@lbLabelAngleF = 10
; cnres@cnLevelSelectionMode = "ExplicitLevels"
; cnres@cnLevels = (/5,15,25,50,75,100,125/)
; cnres@cnFillColors = (/"white","turquoise1","LightSkyBlue","blue","Green3","red","firebrick1","firebrick"/)
cnres@cnFillPalette ="BlWhRe"
cnres@cnLevelSelectionMode = "ManualLevels"
cnres@cnMinLevelValF = -5 ; set min contour level
cnres@cnMaxLevelValF = 5 ; set max contour level
cnres@cnLevelSpacingF = 0.2 ; set contour spacing
cnres@cnLevelSpacingF = 0.2
; Newer way to subset a color map
cmap = read_colormap_file("BlWhRe")
; cnres@cnFillPalette = cmap(25:120,:)
cnres@gsnLeftString = "Temp"
cnres@gsnCenterString = "2014 winter"
;;set vector;;
res_vc = res
res_vc@vcGlyphStyle = "LineArrow"
res_vc@vcLineArrowThicknessF = 5
res_vc@vcMinDistanceF = 0.01
res_vc@vcRefLengthF = 0.02
res_vc@vcLineArrowColor = "dark Green"
;;wind barb resources don't apply
;; res_vc@vcGlyphStyle = "WindBarb"
;; res_vc@vcWindBarbLineThicknessF = 2
;; res_vc@vcWindBarbColor = "Green"
res_vc@vcRefAnnoOn = True
res_vc@vcRefMagnitudeF = 1
res_vc@vcRefAnnoString1 = "1"
res_vc@vcRefAnnoSide = "Top"
res_vc@vcRefAnnoString2On = False
res_vc@vcRefAnnoPerimOn = False
res_vc@vcRefAnnoOrthogonalPosF = -0.12
res_vc@vcRefAnnoParallelPosF = 0.999
res_vc@vcRefAnnoBackgroundColor = "Purple"
res_vc@vcVectorDrawOrder = "PostDraw"
res_vc@gsnRightString = "Wind"
;;plot;;
map = gsn_csm_map(wks,mpres)
contour = gsn_csm_contour(wks,diffT,cnres)
vector = gsn_csm_vector(wks,diffU,diffV,res_vc)
;;overlay filled contours and vectors on the map;;
overlay(map,contour)
overlay(map,vector)
;;add text;;
txres = True
txres@txFontHeightF = 0.02
txres@txFontColor = "Purple"
txres@txBackgroundFillColor = "White"
txres@txFontOpacityF = 0.4
txres@txFontThicknessF = 2.0
dum = gsn_add_text(wks,(/vector/),"surface",105,52.7,txres)
;;drawing "map" will draw everything: map, contours, vectors, and text;;
draw(map)
frame(wks)
其中这一行 mpres@pmTickMarkDisplayMode = "Always"是我后来加上的,别的都没动。谢谢各位大侠! |
|