load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin arr = (/-2.22,-0.54,-1.4, -3.,-1.2,0.1/) ; Data for bars. minval = (/-2.6, -0.68, -2., -4.,-1.4/) maxval = (/-1.87,-0.4, -1.,-1.9,-1.0/) wks = gsn_open_wks("ps","bar1g") ; Open "bar1g.ps" PS file. gsn_merge_colormaps(wks,"BlWhRe","default") ; Merge two color maps. res = True ; Plot options desired. res@gsnDraw = False ; Turn off draw/frame b/c we want res@gsnFrame = False ; to attach stuff to plot first. res@vpWidthF = 0.8 ; Change aspect ratio of plot. res@vpHeightF = 0.44 res@trXMinF = 0 ; Set X and Y axes limits. res@trXMaxF = 7 res@trYMinF = -4.8 res@trYMaxF = 1 res@gsnXYBarChart = True res@gsnYRefLine = 0. ; Reference line, necessary ; for bar chart. res@gsnXYBarChartBarWidth = 0.5 ; Change bar widths res@tiYAxisString = "Radiative Forcing " + \ "(Watts per square meter)" res@tiYAxisFontHeightF = 0.015 res@tiYAxisOffsetXF = -.017 ; Move Y label toward plot. res@tmXBOn = False ; Turn off top, bottom, res@tmXTOn = False ; and right tickmarks. res@tmYROn = False res@tmYLLabelFontHeightF = 0.015 ; Font sizes res@tmYLLabelDeltaF = -0.5 ; Scoot towards plot. res@tmYLPrecision = 1 ; No zeros after decimal res@xyLineThicknessF = 3 ; 3x as thick. res@xyLineColors = (/"red","blue","blue","blue",\ "blue","blue"/) plot = gsn_csm_xy(wks,ispan(1,6,1),arr,res) ; Create the plot, but ; don't draw it. l1dum = new(5,graphic) ; Dummy variables for adding polylines. l2dum = new(5,graphic) l3dum = new(5,graphic) lres = True ; Polyline mods desired lres@gsLineColor = "black" ; Color of lines lres@gsLineThicknessF = 2.5 ; Thickness of lines time = fspan(1,5,5) colors = (/"darkgreen","darkgreen","darkgreen","darkgreen","darkgreen"/) do ii = 0,4 lres@gsLineColor = colors(ii) l1dum(ii) = gsn_add_polyline(wks,plot,(/time(ii),time(ii)/), \ (/minval(ii),maxval(ii)/),lres) l2dum(ii) = gsn_add_polyline(wks,plot,(/time(ii)-.08,time(ii)+.08/), \ (/maxval(ii),maxval(ii)/),lres) l3dum(ii) = gsn_add_polyline(wks,plot,(/time(ii)-.08,time(ii)+.08/), \ (/minval(ii),minval(ii)/),lres) end do draw(plot) ; Drawing the plot will now draw everything attached frame(wks) ; to it. Don't forget to advance the frame! end