; ; panel_9.ncl ; ; example provided by adam phillips. ; ;************************************************ load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" ;************************************************ begin ;******************** ; get data ;******************** xyarr = new ((/2,101/),float) dir = "/fs/cgd/home0/asphilli/Apr00/JHurrell/NaoSlp/NCLexample/" fpath = dir + "pcts.ex1.dat" xyarr = fbindirread(fpath,0,dimsizes(xyarr),"float") fpath2 = dir + "slpeof.ex1.nc" fo = addfile(fpath2,"r") deppat = fo ->DP ;******************** ; plot parameters ;******************** wks = gsn_open_wks("ps","panel") gsn_define_colormap(wks,"BlWhRe") ;******************** ; first plot ;******************** res = True ; plot mods desired res@gsnPolar = "NH" ; select northern hemisphere res@mpMinLatF = 30 ; minimum latitude res@mpGridAndLimbOn = False ; turn off grid res@gsnTickMarksOn = False ; turn off tickmarks res@cnFillOn = True ; color fill res@lbOrientation = "Vertical" ; vertical label bar res@gsnFrame = False ; don't advance frame res@tiMainString = "Departure Pattern (EOF1, SLP)" ; title res@gsnLeftString = " " ; no left string res@gsnRightString = " " ; no right string res@cnLevelSelectionMode = "ManualLevels" ; Manually set the cn Levels res@cnMinLevelValF = -5.0 res@cnMaxLevelValF = 3.0 res@cnLevelSpacingF = .5 res@cnFillColors = (/100,90,75,71,68,65,62,60,57,55,52,52,49,47,44,42,39,36/) ; this controls the size and location of the first plot res@vpXF = 0.2 res@vpWidthF = 0.6 res@vpYF = 0.83 res@vpHeightF = 0.465 plot = gsn_csm_contour_map_polar(wks,deppat,res) ;***************************************** ; second plot ;***************************************** sres = True ; plot mods desired sres@gsnFrame = False ; don't advance frame sres@tmYLLabelFontHeightF = 0.015 ; font height sres@trXMinF = 1899 ; set X-axis max and mins sres@trXMaxF = 2000 sres@trYMinF = -90. ; set Y-axis max and mins sres@trYMaxF = 90. sres@xyLineThicknesses = (/1./) ; Define line thicknesses sres@xyLineColors = (/"black"/) ; Define line color sres@xyMonoDashPattern = True sres@gsnTickMarksOn = True ; turn off tickmarks sres@gsnYRefLine =0. ; Y-value for ref. line sres@gsnAboveYRefLineColor = "Red" ; Color area above ref. line red sres@gsnBelowYRefLineColor = "Blue" ; Color area below ref. line blue sres@gsnCenterString = " " ; no center string ; this controls the size and location of the second plot sres@vpXF = 0.15 sres@vpYF = 0.3 sres@vpWidthF = 0.7 sres@vpHeightF = 0.18 newtime=ispan(1899,1999,1) tsmap2=gsn_csm_xy(wks,newtime,xyarr(0,:),sres) ;***************************************************** ; create other thick line since we did not advance the frame, ; and did not panel this plot using gsn_panel(), we can do this. ;****************************************************** delete(sres@gsnYRefLine) delete(sres@gsnAboveYRefLineColor) delete(sres@gsnBelowYRefLineColor) sres@xyLineThicknesses = (/4./) ; Define line thicknesses sres@xyLineColors = (/"black"/) tsmap3=gsn_csm_xy(wks,newtime,xyarr(1,:),sres) frame(wks) ; advance frame after extra line drawn end