- 积分
- 32392
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-12-11
- 最后登录
- 1970-1-1
|
NCL
系统平台: |
|
问题截图: |
|
问题概况: |
利用gsn_create_legend自动生成的图片,线条和文字对应出了些偏差 |
我看过提问的智慧: |
看过 |
自己思考时长(天): |
3 |
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
opts = xyres
wks = gsn_open_wks("png","d04")
gsn_define_colormap(wks,"default")
base = gsn_csm_xy(wks,xtaus,transpose(D04),opts)
ncol = 3
nrow = toint(ceil(tofloat(nsite)/ncol))
lgres2 = lgres
amres2 = amres
lgres2@vpHeightF = lgres@vpHeightF*nrow
amres2@amOrthogonalPosF = amres@amOrthogonalPosF+lgres2@vpHeightF
mkmode2 = array_append_record(mkmode,mkmode,0)
lnmode2 = array_append_record(lnmode,lnmode,0)
colors2 = array_append_record(colors,colors,0)
labels2 = array_append_record(site,site,0)
colors2(nsite:) = 0
labels2(nsite:) = ""
do i = 0, ncol-1
label = unique_string("label")
annot = unique_string("annot")
index = ispan(0,nrow-1,1)+nrow*i
lgres2@lgMarkerIndexes = mkmode2(index)
lgres2@lgMarkerColors = colors2(index)
lgres2@lgDashIndexes = lnmode2(index)
lgres2@lgLineColors = colors2(index)
lgres2@lgItemOrder = ispan(nrow-1,0,1)
base@$label$ = gsn_create_legend(wks,nrow,labels2(index(::-1)),lgres2)
base@$annot$ = gsn_add_annotation(base,base@$label$,amres2)
amres2@amParallelPosF = amres2@amParallelPosF+lgres2@vpWidthF*1.2
end do
gsn_panel(wks,base,(/1,1/),plres)
delete(opts)
|
|