- 积分
- 1109
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-3-27
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
请教:为什么此脚本加不上图例?按照官网写的
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
data1 = asciiread("/home/Administrator/tpy_7_tpy_6/tpy_7_landslide_sta.txt",(/13/),"float")
data2 = asciiread("/home/Administrator/tpy_7_tpy_6/tpy_6_debrisflow_sta.txt",(/13/),"float")
time = asciiread("/home/Administrator/tpy_7_tpy_6/time.txt",(/13/),"float")
y_1 = data1(:)
y_2 = data2(:)
x = time(:)
labels = (/"landslide","debris_flow"/)
wks = gsn_open_wks("ps","tpy_sta_slandslide_debris_flow")
res1 = True
res1@gsnDraw = False
res1@gsnFrame = False
res1@gsnMaximize = True
res1@vpXF = 0.20
res1@vpYF = 0.75
res1@vpHeightF = 0.40
res1@vpWidthF = 0.65
res1@gsnXYBarChart = True
res1@gsnXYBarChartBarWidth = 0.3
res1@gsnXYBarChartColors = "black"
res1@xyLineThicknesses = 4.0
res1@trYMaxF = 150.
res1@trYMinF = 0.
res1@tmXBMode = "Explicit"
res1@tmXBValues = ispan(1,13,1)
; res1@tmXBLabels = (/"GuangYuan","NanJiang","WanYuan","YiLong","XuanHan","DaZhou","NanChong","RangTang","JinChuan","MaRrKang","WenChuan","LiXian","HeiShui"/)
res1@tmXBLabelFontHeightF = 0.015
res1@tmXTOn = False
res1@tmYROn = False
plot_landslide = gsn_csm_xy(wks,x,y_1,res1)
res2 = True
res2@gsnXYBarChart = True
res2@gsnXYBarChartBarWidth = 0.3
res2@gsnXYBarChartColors = "white"
res2@gsnDraw = False
res2@gsnFrame = False
res2@xyLineThicknesses = 4.0
plot_debrisflow = gsn_csm_xy(wks,x,y_2,res2)
overlay(plot_landslide,plot_debrisflow)
draw(plot_landslide)
lbres = True ; labelbar only resources
lbres@vpWidthF = 0.3 ; labelbar width
lbres@vpHeightF = 0.1 ; labelbar height
lbres@lbBoxMajorExtentF = 0.36 ; puts space between color boxes
lbres@lbFillColors = (/"black","white"/)
lbres@lbMonoFillPattern = True ; Solid fill pattern
lbres@lbLabelFontHeightF = 0.015 ; font height. default is small
lbres@lbLabelJust = "CenterLeft" ; left justify labels
lbres@lbPerimOn = False
lbres@lgPerimColor = "white"
labels = (/"landslide", "debris_flow"/)
gsn_labelbar_ndc(wks,2,labels,10,140,lbres)
frame(wks)
end
|
|