您好,登錄后才能下訂單哦!
這篇文章主要介紹“NCL常用統計學函數怎么用”,在日常操作中,相信很多人在NCL常用統計學函數怎么用問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”NCL常用統計學函數怎么用”的疑惑有所幫助!接下來,請跟著小編一起來學習吧!
undef("draw_eof_plot")
procedure draw_eof_plot(dir_plot,file_plot,type_plot,x,year,neof)
begin
;--EOF analysis
optEof = True
eof = eofunc_Wrap( x, neof, optEof)
eof_ts = eofunc_ts_Wrap( x, eof, False)
lat = x&lat
lon = x&lon
;--Begin plotting section.
wks = gsn_open_wks(type_plot,dir_plot+file_plot) ; Opens a ps file
gsn_define_colormap(wks,"rainbow")
plot = new(neof,graphic)
res = True ; plot mods desired
;************************************************
; original data
;************************************************
res@gsnDraw = False ; don't draw yet
res@gsnFrame = False ; don't advance frame yet
res@gsnAddCyclic = False
;--map plot resources
res@mpFillOn = False ; no grey continents
res@mpCenterLonF = 180.
res@mpDataBaseVersion = "MediumRes" ; or "Ncarg4_1"
res@mpDataSetName="Earth..4"
res@mpOutlineSpecifiers=(/"China:states","Taiwan"/)
res@mpOutlineBoundarySets = "AllBoundaries"
res@mpMinLatF = min(lat) ; range to zoom in on
res@mpMaxLatF = max(lat)
res@mpMinLonF = min(lon)
res@mpMaxLonF = max(lon)
;--contour resources
res@cnFillOn = True ; turn on contour fill
res@cnLineLabelsOn = False ; turn off contour
res@cnLinesOn = False ; add countor or not,True is default
res@gsnLeftString = " "
res@gsnRightString = " "
;--tickmark resources
res@tmXTOn = False
res@tmYROn = False
res@tmYLLabelFontHeightF =0.02
res@tmXBLabelFontHeightF =0.018
res@tmXTOn = False
res@tmYROn = False
;--labelbar resources
res@lbLabelBarOn = False
res@lbLabelFontHeightF = 0.02
res@lbOrientation = "Vertical" ; vertical label bar
symMinMaxPlt(eof, 16, False, res); contributed.ncl
; panel plot only resources
resP = True ; modify the panel plot
resP@gsnMaximize = True ; large format
resP@gsnPanelLabelBar = True ; add common colorbar
resP@txString = "EOF"
do n=0,neof-1
res@gsnLeftString = " EOF "+(n+1)
res@gsnRightString = sprintf("%5.1f", eof@pcvar(n)) +"%"
plot(n) = gsn_csm_contour_map(wks,eof(n,:,:),res)
end do
gsn_panel(wks,plot,(/neof/1,2/),resP) ; draw all 'neof' as one plot
;*******************************************
; time series (principal component) plot
;*******************************************
eof_ts@long_name = "Amplitude"
rts = True
rts@gsnDraw = False ; don't draw yet
rts@gsnFrame = False ; don't advance frame yet
; decide exactly where on the page to draw it.
rts@vpHeightF = 0.40 ; Changes the aspect ratio
rts@vpWidthF = 0.85
rts@vpXF = 0.10 ; change start locations
rts@vpYF = 0.75 ; the plot
rts@gsnYRefLine = 0. ; reference line
rts@gsnAboveYRefLineColor = "red" ; above ref line fill red
rts@gsnBelowYRefLineColor = "blue" ; below ref line fill blue
; panel plot only resources
rtsP = True ; modify the panel plot
rtsP@gsnMaximize = True ; large format
rtsP@txString = "EOF"
do n=0,neof-1
rts@gsnLeftString = " EOF "+(n+1)
rts@gsnRightString = sprintf("%5.1f", eof@pcvar(n)) +"%"
plot(n) = gsn_csm_xy (wks,year,eof_ts(n,:),rts)
end do
gsn_panel(wks,plot,(/neof/1,2/),rtsP) ; draw all 'neof' as one plot
end
到此,關于“NCL常用統計學函數怎么用”的學習就結束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續學習更多相關知識,請繼續關注億速云網站,小編會繼續努力為大家帶來更多實用的文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。