爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 4668|回复: 1

[作图] 插值图如何设置所画区域外为透明色

[复制链接]
发表于 2017-11-6 13:24:27 | 显示全部楼层 |阅读模式

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

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

x
问一下大家,我用ncl画的插值图,数据是全国的,然后我选取河南地区画出来,现在是叠加了河南区域外为白色图,有办法让这张图里的白色区域转为透明吗?是不是只能抠图啊?因为我直接在ncl设置叠加图透明色的话河南以外的区域又有颜色了

如果是抠图的话NCL能实现吗

河南

河南
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-11-6 13:26:55 | 显示全部楼层
画图脚本如下:::、


;**********set geographic**********
  res@mpGridAndLimbOn       = True
  res@mpGridLineColor       = "red"
  res@mpGridLatSpacingF     = 1
  res@mpGridLonSpacingF     = 1
  res@mpGridLineDashPattern = 16
  res@mpGridLineThicknessF  = 0.2

  res@mpMaxLatF = 37
  res@mpMinLatF = 31
  res@mpMaxLonF = 117
  res@mpMinLonF = 109

;******set map**********                 

  res@mpDataSetName              = "Earth..4"
  res@mpDataBaseVersion          = "MediumRes" ; or "Ncarg4_1"

  res@mpAreaMaskingOn            = True
  res@mpOutlineOn                = True
  res@mpMaskAreaSpecifiers       = (/"China:henan"/)
  res@mpOutlineSpecifiers        = (/"China:henan"/)
  res@mpOceanFillColor           = 0
  res@mpInlandWaterFillColor     = 0
  res@mpLandFillColor            = 0
  res@mpOutlineBoundarySets      = "NoBoundaries"

  res@mpShapeMode                = "FreeAspect"
  res@mpFillDrawOrder            = "PostDraw"
  res@tmXBLabelFontHeightF   = 0.018

  res@cnLinesOn        = False
  res@cnFillOn         = True
  res@cnLineColor      = "white"
  res@cnLineThicknessF = 0.5
  res@lbOrientation    = "Vertical" ; 麓鹿直掳诜?
  res@cnLevelSelectionMode = "ExplicitLevels"
;  res@cnMinLevelValF       = 0     
  res@cnFillDrawOrder      = "PreDraw"
  res@cnFillDrawOrder      = "PreDraw"
;                      add China map
;>------------------------------------------------------------<

   cnres           = True
   cnres@china     = True       ;draw china map or not
   cnres@river     = False       ;draw changjiang&huanghe or not
   cnres@province  = False       ;draw province boundary or not
   cnres@nanhai    = False       ;draw nanhai or not
   cnres@diqu      = True       ; draw diqujie or not


;;;*************draw pols!**********
   res@cnLevels        = (/0,10,20,30,40,45,50,55,60,65,70,75,80,90,100,115,130,140,150,160,170,175,180,190,200,220,240,250,270,290,300,500/)
   res@cnExplicitLabelBarLabelsOn= True
   res@lbLabelStrings  = (/"0","","","","","","50","","","","","","","","100","","","","150","","","","","","200","","","","","","300",""/)


        plot = gsn_csm_contour_map (wks,var,res)
        chinamap = add_china_map(wks,plot,cnres)
        draw(plot)
        frame(wks)
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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