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

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 6187|回复: 2

[作图] NCL绘制青藏高原的边界(已有边界经纬度坐标)

[复制链接]

新浪微博达人勋

发表于 2020-4-10 19:32:50 | 显示全部楼层 |阅读模式

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

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

x
老师给了一个青藏高原边界的经纬度坐标的txt文件,读入文件之后不知道怎么画出边界轮廓,求各位大神解答,谢谢!下面是我的脚本和图:
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/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/cnmap.ncl"
begin
minGlat=25.
maxGlat=40.
minGlon=74.
maxGlon=104.
;Three river source header"
slat=31.7
elat=36.2
slon=89.5
elon=102.2
slat2=31.7-1.
elat2=36.2-1.
slon2=89.5-1.
elon2=102.2-1.
f = addfile("$NCARG_ROOT/laiavgrcp85.nc","r")
lai1 = f->lai
wks = gsn_open_wks("png","laiavgrcp85")
res= True
res@gsnDraw            = False             ; don't draw yet
res@gsnFrame           = False             ; don't advance frame yet
res@cnLevelSpacingF = 0.5
res@gsnAddCyclic      = False
res@cnFillOn             = True           ; Turn off contour lines
res@cnLinesOn            = False           ; Turn off contour lines
res@cnFillPalette      =  "NOC_ndvi"
res@cnFillMode           = "RasterFill"
plot = gsn_csm_contour(wks,lai1(0,:,:),res)
cnres           = True
cnres@china     = False       ;draw china map or not
cnres@river     = True       ;draw changjiang&huanghe or not
cnres@province  = True       ;draw province boundary or not
cnres@nanhai    = False       ;draw nanhai or not
cnres@diqu      = False       ; draw diqujie or not

chinamap = add_china_map(wks,plot(0),cnres)
;TP boundary
coord = asciiread("$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/TP_boundary.txt",(/7300,2/),"float");读入文件下面该怎样绘图
;panel plot

draw(plot)
frame(wks)
end




laiavgrcp85.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2020-4-10 19:50:09 | 显示全部楼层
试试看gsn_polygon_ndc绘制多边形
或者gsn_add_polygon绘制折线,这个的话应该要n+1个点,第一个点和第n+1个点一样形成闭合多边形
gsFillColor修改填充颜色
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2020-4-10 20:33:17 | 显示全部楼层
一大碗年糕 发表于 2020-4-10 19:50
试试看gsn_polygon_ndc绘制多边形
或者gsn_add_polygon绘制折线,这个的话应该要n+1个点,第一个点和第n+1 ...

好的,感谢!我去试试!
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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