- 积分
- 446
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2021-9-18
- 最后登录
- 1970-1-1
|
40金钱
用ncl绘制多折线图,多出来一根越出绘图边界的直线(紫色的那个直线)
不知道是哪里的问题,恳请各位大佬指点!!
代码如下:
begin
R=new((/4,30/),float)
g=0.3
c=(/10000,30000,60000,90000/)
waveL=ispan(100,3000,100)
pai=3.1415926
; 计算响应函数
do ir=0,dimsizes(c)-1
do iw=0,dimsizes(waveL)-1
R0=exp(-4 * pai^2 * c(ir) / waveL(iw)^2)
R(ir,iw)=R0*(1 + R0^(g-1) - R0^g)
end do
end do
;------plot kind------
type="x11"
;type="png"
;type="pdf"
;------creat workstation------
wks=gsn_open_wks(type, "barnes-scheme")
; 绘图
res=True
res@gsnDraw=False
res@gsnFrame=False
res@trYMaxF=1
res@trYMinF=0
res@vpXF=0.2
res@vpYF=0.9
res@vpHeightF=0.7
res@vpWidthF=0.7
res@tmBorderThicknessF=7
; 叠加折线
res2=res
res2@tmXTOn=False
res2@tmYROn=False
res2@tiYAxisString="Response Function"
res2@tiYAxisFontHeightF=0.03
res2@tiYAxisOffsetXF=0.012
res2@tiXAxisString="WaveLength (10^2 km)"
res2@tiXAxisFontHeightF=0.03
res2@tmXTOn=False
res2@tmYROn=False
res2@tmXBLabelFontHeightF = 0.03 ; Default is a bit large
res2@tmYLLabelFontHeightF = 0.03
res2@tmXBLabelDeltaF=-0.8
res2@tmYLLabelDeltaF=-0.7
;res2@tmXBLabelJust="TopLeft"
res2@tmXBMajorLengthF=0.01
res2@tmXBMajorOutwardLengthF=0.01
res2@tmXBMajorThicknessF=6
res2@tmXBMinorOn=False
res2@tmYLMajorLengthF=0.01
res2@tmYLMajorOutwardLengthF=0.01
res2@tmYLMajorThicknessF=6
res2@tmYLMinorOn=False
res2@gsnXYBarChart=False
colors=(/"brown2","forestgreen","dodgerblue","darkviolet"/)
res2@xyLineColors=colors
res2@pmLegendDisplayMode="Always" ; 图例
res2@pmLegendWidthF=0.1
res2@pmLegendHeightF=0.12
res2@pmLegendOrthogonalPosF=-0.4
res2@pmLegendParallelPosF=0.84
res2@xyExplicitLegendLabels=(/"c=10000","c=30000","c=60000","c=90000"/)
res2@lgPerimOn=False
res2@lgLabelFontHeightF=0.02
res2@lbBoxMinorExtentF=0.3
res2@lgItemOrder=(/3,2,1,0/)
res2@xyDashPattern=0
res2@xyLineThicknessF=6
;run_ave=runave_Wrap(ave(1:,:), 4, 0) ; 折线平滑
res2@gsnLeftString ="Barnes Filtering Scheme"
res2@gsnLeftStringFontHeightF=0.03
res2@gsnLeftStringOrthogonalPosF=-0.015
res2@gsnRightString=""
plot=gsn_csm_xy(wks,waveL/100,R,res2)
draw(plot)
frame(wks)
end
|
-
最佳答案
查看完整内容
R = where(R.eq."-nan",R@_FillValue,R)
|