;************************************************* ; panel_24.ncl ; ; Concepts illustrated: ; - Paneling six plots on a page ; - Selecting a plot on which to base the scale factor for paneled plots ; - Changing the width and height of a plot ; - Changing the color of tickmark labels ; ;************************************************* ; ; These files are loaded by default in NCL V6.2.0 and newer ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin npts = 50 nplots = 6 y = new((/nplots,npts/),float) plot = new(nplots,graphic) plot2 = new(1,graphic) ybeg = (/0.00001,-5, 1, 0, 10, 10/) yend = (/1.00000, 5, 5,20, 50, 20/) wks = gsn_open_wks("png","panel") ; send graphics to PNG file res = True res@gsnDraw = False res@gsnFrame = False res@vpWidthF = 0.8 ; set width of plot res@vpHeightF = 0.3 ; set height of plot do i=0,nplots-1 ; if(i.eq.2) ; res@xyLineColor = "Blue" ; res@tmYLLabelFontColor = "Blue" ; else ; res@xyLineColor = "Black" ; res@tmYLLabelFontColor = "Black" ; end if y(i,:) = random_uniform(ybeg(i),yend(i),npts) res@xyLineColor = "blue" plot(i) = gsn_csm_xy(wks,fspan(1,npts,npts),y(i,:),res) res@xyLineColor = "red" plot2 = gsn_csm_xy(wks,fspan(1,npts,npts),y(i,:)+1,res) overlay(plot(i),plot2) end do pres = True pres@gsnMaximize = True pres@gsnPanelMainString = "Scale factor based on first plot in list" gsn_panel(wks,plot,(/3,2/),pres) ; pres@gsnPanelMainString = "Scale factor based on third (largest) plot in list" ; pres@gsnPanelScalePlotIndex = 2 ; 3rd plot in list, which is the biggest ; gsn_panel(wks,plot,(/3,2/),pres) ; draw(wks) end