- 积分
- 7865
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-3-27
- 最后登录
- 1970-1-1
|
NCL
系统平台: |
|
问题截图: |
- |
问题概况: |
NCL txt数据画多条不同标度的X轴曲线(不同颜色的曲线对应不同标度的X轴),共用一个Y轴(XY型) |
我看过提问的智慧: |
看过 |
自己思考时长(天): |
7 |
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
NCL txt数据画多条不同标度的X轴曲线(不同颜色的曲线对应不同标度的X轴),共用一个Y轴(XY型)
在longlivehj的帮助下,已经给出画图的总体轮廓。由于是初学,所以,有一些问题还没搞明白。
1.使用的是txt数据,不同变量的数据是按照列排列的。多X轴的情况下应该如何排列、读取?
2.目前能看到plot1 = gsn_csm_xy(wks, u1, u1&lat, res1)。应该是最基本的XY画图。后面的@基本能看明白代表的意义。但是不明白res2 3 4和plot2 3 4的思路。
getvalues plot2
"trXMinF": xmin
"trXMaxF": xmax
end getvalues
x = new(2, "float")
y = new(2, "float")
x(:) = 0.
y(:) = 0.
这两部分也不太明白。getvalues和第二部分在ncl里面起的作用没有思路。
看资料上写的@是设定画图的要求。但对于为什么加res和plot等没有头绪。所以想知道画这个图像时的画图思路以及是如何实现的。
望高手解疑答惑。
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
f = addfile ("$NCARG_ROOT/lib/ncarg/data/cdf/uv300.nc","r")
u = f->U
u1 = u(0, :, {0})
u2 = u(0, :, {80}) + 50.
u3 = u(0, :, {160}) + 100.
wks = gsn_open_wks ("x11","3x")
res1 = True
res1@gsnFrame = False
res1@vpHeightF = .3
res1@xyLineColor = "red"
res1@tiXAxisString = "x1"
plot1 = gsn_csm_xy(wks, u1, u1&lat, res1)
res2 = res1
res2@xyLineColor = "green"
res2@tiXAxisString = ""
res2@tmXBOn = False
res2@tmXBBorderOn = False
res2@tmXTOn = False
res2@tmXTBorderOn = False
res2@tmYLOn = False
res2@tmYLBorderOn = False
res2@tmYROn = False
res2@tmYRBorderOn = False
plot2 = gsn_csm_xy(wks, u2, u1&lat, res2)
getvalues plot2
"trXMinF": xmin
"trXMaxF": xmax
end getvalues
res3 = res2
res3@vpYF = .7
res3@trXMinF = xmin
res3@trXMaxF = xmax
res3@tmXBOn = True
res3@tmXBBorderOn = True
res3@tiXAxisString = "x2"
x = new(2, "float")
y = new(2, "float")
x(:) = 0.
y(:) = 0.
plot3 = gsn_csm_xy(wks, x, y, res3)
res2@xyLineColor = "blue"
plot4 = gsn_csm_xy(wks, u3, u1&lat, res2)
getvalues plot4
"trXMinF": xmin
"trXMaxF": xmax
end getvalues
res3@vpYF = .6
res3@tiXAxisString = "x3"
res3@trXMinF = xmin
res3@trXMaxF = xmax
plot5 = gsn_csm_xy(wks, x, y, res3)
frame(wks)
end
|
|