- 积分
- 1804
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-3-15
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
按照站内大佬http://bbs.06climate.com/forum.p ... hlight=%D6%D0%CE%C4的方法,使用https://github.com/WCHAR-NCL/Dot-Matrix下载的压缩包,改了WCHAR.ncl的路径,但还是出了问题,显示fontX(wks, plot, "中文测试",180,0, ftres),这一行出错,求大佬看一下这个报错要怎么解决呀,除去这一行是能正常运行的。
代码如下:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/Dot-Matrix-master/WCHAR.ncl"
begin
f = addfile("D:/dm/kanu/ncl/ceshi/salinity1.nc","r")
salinity = f->salinity(0,0,:,:)
wks = gsn_open_wks("png","D:/dm/kanu/ncl/ceshi/salinity")
res = True
res@mpFillOn = True
res@mpCenterLonF = 180
res@mpMinLatF = -30
res@mpMaxLatF = 30
res@mpMinLonF = 120
res@mpMaxLonF = 280
res@mpAreaMaskingOn = True
res@mpOutlineSpecifiers = (/"oceans"/)
res@cnFillDrawOrder = "Predraw"
res@cnFillOn = True
res@cnConstFEnableFill = True
res@cnCellFillMissingValEdgeColor = True
res@cnFillPalette = "cmp_b2r"
res@gsnAddCyclic = False
res@cnLinesOn = False
res@cnLineLabelsOn = False
res@cnLevelSelectionMode = "ManualLevels"
res@tmXTOn = False
res@tmYROn = False
res@tmXBLabelFontHeightF = 0.017
res@tmYLLabelFontHeightF = 0.017
res@lbLabelsOn = False
res@lbLabelBarOn = False
res@lbLabelFontHeightF = 0.017
res@tiMainString = ""
res@gsnRightString = ""
res@gsnLeftString = ""
res@cnLineLabelsOn = False
res@tmXBLabelFontHeightF = 0.02
res@tmYLLabelFontHeightF = 0.02
res@pmLabelBarWidthF = 0.07
res@vpWidthF = 0.7
res@vpHeightF = 0.25
res@cnMaxLevelValF = 37
res@cnMinLevelValF = 34
res@cnLevelSpacingF = 0.25
plot = gsn_csm_contour_map(wks,salinity,res)
ftres = True
ftres@fontQuality = "High"
ftres@fontSize = 16
ftres@fontColor = "blue"
ftres@fontName = "S"
ftres@fontEncoding = "utf8";GBK有问题
ftres@fontJust = "BottomLeft"
ftres@fontAngleF = 0.
ftres@fontNDC = True
fontX(wks, plot, "中文测试",180,0, ftres)
end
|
|