爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 5554|回复: 1

[作图] 画map图加上经纬度的圈之后colorbar没有了

[复制链接]
发表于 2017-12-15 14:04:30 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

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"是我后来加上的,别的都没动。谢谢各位大侠!
密码修改失败请联系微信:mofangbao
发表于 2018-1-26 15:40:28 | 显示全部楼层
没图?不好说
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表