请选择 进入手机版 | 继续访问电脑版
爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 5868|回复: 2

[作图] NCL画图求教

[复制链接]

新浪微博达人勋

发表于 2016-5-30 19:28:59 | 显示全部楼层 |阅读模式

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

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

x
今天在用NCL画图是想做这样一件事:全球72×36的A气候资料,已shaded在全球地图上,现在想在图上再叠加一个变量B,让绝对值大于0.5的B值画在图上。在官网找半天也没找天(原谅我是一个初学者,刚学第二天。。。痛苦)。后来退而求其次让小于-0.5与大于0.5的部分画阴影,在论坛里找到了ShadeLtGtContour,可是用的时候cgwin里面说ShadeLtGtContour未定义。我用的应该是6.2.1版本。错误如下:
fatal:Undefined identifier: (ShadeLtGtContour) is undefined, can't continue

fatal:["Execute.c":8578]:Execute: Error occurred at or near line 36 in file nianfenzhihou.ncl  我在官网看见说ShadeLtGtContour过时了,是不是这个原因呢?


我写的程序如下:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
f=addfile("C:/MDVST1901_2014/NAOzhihou/MDVSTyuNAOzhihouxiangguan.nc","r")
tzhihou=f->tzhihou
jianyan=f->jianyan
tzhihouxishu=f->tzhihouxishu
tzhihou=mask(tzhihou,jianyan.gt.0.05,False)
tzhihouxishu=mask(tzhihouxishu,jianyan.gt.0.05,False)
wks=gsn_open_wks("png","C:/MDVST1901_2014/NAOzhihou/nianfen")
gsn_define_colormap(wks,"rainbow")
res=True
res@gsnFrame=False
res@mpMinLatF =-60
res@cnLevelSelectionMode="ManualLevels"
res@cnMinLevelValF=13 ;滞后年份最小值
res@cnMaxLevelValF=30 ;滞后年份最大值
res@cnLevelSpacingF=1 ;间隔
res@gsnSpreadColorStart=14 ;起始于color index 14
res@cnFillOn=True;打开等值线颜色
res@cnLinesOn=False;关闭等值线线条
res@lbBoxLinesOn=False;关闭lbar box线条
res@gsnLeftString         = ""       ; turn off subtitles
res@gsnRightString        = ""
res@gsnCenterString       = ""
plot1=gsn_csm_contour_map(wks,tzhihou,res)
;-----显著性检验-----
res2=True               
res2@cnFillOn=True
res2@cnLinesOn=True
res2@cnLevelSpacingF = 0.05
res2@gsnLeftString         = ""       ; turn off subtitles
res2@gsnRightString        = ""
res2@gsnCenterString       = ""
plot2=gsn_csm_contour_map(wks,tzhihouxishu,res2)
plot2=ShadeLtGtContour(plot2,-0.5,8,0.9,5)
draw(plot2)  
overlay(plot1,plot2)
frame(wks)
end


求大神帮助呀!!!
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-5-31 08:31:58 | 显示全部楼层
需要添加
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
两个库
是用函数之前建议到官网的functions里查看详细的使用说明
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-11-15 09:36:54 | 显示全部楼层
sinagzy 发表于 2016-5-31 08:31
需要添加
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/ ...

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

本版积分规则

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

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

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