爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 6295|回复: 4

ncl填色图与矢量场叠加出错

[复制链接]

新浪微博达人勋

发表于 2018-9-8 20:43:08 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 英英茵 于 2018-9-8 20:45 编辑

填色图与矢量图最后的叠加效果是仅显示矢量图和填色图的色标  个人感觉是填色图的经纬度问题  但是因为在设置叠加时使用的是overlay(map,填色)所以在设置填色的命令中不需要对地图进行设置  下面贴上画图脚本  希望有大神能解答下

wks = gsn_open_wks("png","C:/Users/WuQiuuu/Desktop/20187yuepre/vapour_flux") ;+i)
gsn_define_colormap(wks,"BlAqGrYeOrReVi200")


mpres      = True
mpres@mpMinLonF            = 60.               ; select a subregion
mpres@mpMaxLonF            = 130.
mpres@mpMinLatF            = 0.
mpres@mpMaxLatF            = 60.
mpres@vpWidthF             = 0.65
mpres@vpHeightF            = 0.6

mpres@mpOutlineOn              = True
mpres@mpOutlineSpecifiers      = (/"China"/)  ; continents only
mpres@mpNationalLineThicknessF = 3.5
mpres@mpFillOn                 =True
mpres@mpLandFillColor          ="white"
mpres@pmTickMarkDisplayMode    ="always"
mpres@mpGeophysicalLineThicknessF=3.5
mpres@mpGeophysicalLineColor = "black"
map = gsn_csm_map(wks, mpres)



cnres           = True
cnres@gsnAddCyclic  = False
;cnres@gsnDraw      = True                        ; don't draw yet
;cnres@gsnFrame     = True     
cnres@vpWidthF             = 0.65
cnres@vpHeightF            = 0.6
cnres@pmTickMarkDisplayMode    ="always"
cnres@cnLinesOn=False
cnres@cnLineLabelsOn=False
cnres@cnFillOn=True
cnres@cnLevelSelectionMode = "ManualLevels"     ; set manual contour levels
cnres@cnFillDrawOrder  = "Predraw"         ; areas before map gets
cnres@cnInfoLabelOn = False
cnres@lbOrientation        = "Horizontal";"Vertical" ;    ; vertical label bar
cnres@lbLabelFontHeightF = 0.013
cnres@pmLabelBarHeightF  = 0.05
cnres@pmLabelBarWidthF   = 0.4
;cnres@pmLabelBarParallelPosF = -1            ;shuiping
cnres@pmLabelBarOrthogonalPosF = 0.15         ;chuizhi

con = gsn_csm_contour(wks,mm,cnres)



vcres = True
vcres@gsnAddCyclic  = False
vcres@gsnDraw      = False                        ; don't draw yet
vcres@gsnFrame     = False                        ; don't advance frame yet
vcres@vpWidthF             = 0.65
vcres@vpHeightF            = 0.6

vcres@lbLabelBarOn = True
vcres@vcRefMagnitudeF         = 20.0              ; make vectors larger
vcres@vcRefLengthF            = 0.0018            ; ref vec length
vcres@vcGlyphStyle            = "LineArrow";"CurlyVector"    ; turn on curly vectors
vcres@vcMinDistanceF          = 0.017            ; thin out vectors
vcres@vcRefAnnoOn = True
vcres@vcRefAnnoString2On = True
vcres@vcRefAnnoString2 = "20 m/s"
vcres@vcRefAnnoSide = "top"
vcres@vcMonoFillArrowFillColor  = True
vcres@vcLineArrowThicknessF  = 2.0
vcres@vcRefAnnoOn  =False
vcres@vcVectorDrawOrder= "PostDraw"
vcres@tiMainString          ="vaper_flux : kg/(m*s)"

vec = gsn_csm_vector(wks,avgvintqu,avgvintqv,vcres); create plot



overlay(map,vec)
overlay(map,con)


;draw(plot)
;draw(plot1)
draw(map)
frame(wks)
end



输出的图片分别是这三张
file:///C:\Users\WuQiuuu\AppData\Roaming\Tencent\Users\975055943\QQ\WinTemp\RichOle\7LAH_HOS5IM]ON22XDJP9ES.png

file:///C:\Users\WuQiuuu\AppData\Roaming\Tencent\Users\975055943\QQ\WinTemp\RichOle\)9URXWK9XVEHB~JJEUW9SR7.png
拜托了

vapour_flux.000001.png
vapour_flux.000002.png
vapour_flux.000003.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-9-10 09:20:31 | 显示全部楼层
false啊false,gsndraw和gsnframe都要false。不设的话默认是true,你把true那两句注释和不注释没区别
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-9-10 14:05:00 | 显示全部楼层
井中月 发表于 2018-9-10 09:20
false啊false,gsndraw和gsnframe都要false。不设的话默认是true,你把true那两句注释和不注释没区别

如果改成false 那么出图的后两张都是矢量图+色标的那个 也不能完全出图
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-9-11 09:23:30 | 显示全部楼层
英英茵 发表于 2018-9-10 14:05
如果改成false 那么出图的后两张都是矢量图+色标的那个 也不能完全出图

map,con,vec三个里面的draw和frame都要false
另外,overlay(map,vec)和overlay(map,con)的顺序我觉得要颠倒一下
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-9-11 10:41:09 | 显示全部楼层
井中月 发表于 2018-9-11 09:23
map,con,vec三个里面的draw和frame都要false
另外,overlay(map,vec)和overlay(map,con)的顺序我觉得 ...

谢谢  我去试试
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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