;---------------------------------------------------------------------- ; panel_15.ncl ; ; Concepts illustrated: ; - Combining two sets of paneled plots on one page ;---------------------------------------------------------------------- ; This script is similar to panel_15_old.ncl, except a function called ; "panel_two_sets" was used to make it easier to panel two sets of ; plots. ; ; This function enables you to panel two sets of contour plots on the ; same page, each with its own labelbar. The function will determine ; whether to use horizontal or vertical labelars, depending on how ; the two sets of plots are laid out in terms of rows and columns. ;---------------------------------------------------------------------- ; You must download panel_two_sets.ncl for this script to run. ;---------------------------------------------------------------------- load "./panel_two_sets.ncl" begin in = addfile("h_avg_Y0191_D000.00.nc","r") t = in->T ;---Create first two individual plots wks = gsn_open_wks("png","panel") ; send graphics to PNG file plot = new(2,graphic) res = True ; plot mods desired res@cnFillOn = True ; turn on color res@cnLinesOn = False ; turn off contour lines res@cnLineLabelsOn = False ; turn off contour lines res@cnFillPalette = "gui_default" ; set color map res@lbLabelBarOn = False ; turn off individual label bars res@gsnDraw = False ; don't draw yet res@gsnFrame = False ; don't advance frame yet res@gsnAddCyclic = False ; data already has cyclic point res@cnLevelSelectionMode = "ManualLevels"; manual set levels so lb consistent res@cnMinLevelValF = 0 ; min level res@cnMaxLevelValF = 28 ; max level res@cnLevelSpacingF = 2 ; contour interval res@mpLandFillColor = "white" ; make land white res@gsnCenterString = "level 0" plot(0) = gsn_csm_contour_map(wks,t(0,0,:,:),res) res@gsnCenterString = "level 1" plot(1) = gsn_csm_contour_map(wks,t(0,1,:,:),res) ;---Create third individual plots res@cnMinLevelValF = 0 ; min level res@cnMaxLevelValF = 20 ; max level res@cnLevelSpacingF = 2 ; contour interval res@gsnCenterString = "level 6" plot2 = gsn_csm_contour_map(wks,t(0,6,:,:),res) ;---Panel the two sets of plots pres1 = True ; Resources specific to first set of paneled plots pres2 = True ; Resources specific to second set of paneled plots pres = True ; For setting the area of paneled plots pres1@pmLabelBarOrthogonalPosF = -0.02 ; Move closer to plots pres2@pmLabelBarOrthogonalPosF = -0.02 ; pres@gsnPanelTop = 1.0 ; set these if desired ; pres@gsnPanelBottom = 0.0 ; must be between 0 and 1 ; pres@gsnPanelLeft = 0.0 ; pres@gsnPanelRight = 1.0 panel_two_sets(wks,plot,plot2,(/2,1/),(/1,1/),pres1,pres2,pres) end