load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" begin ;---Create some data. We cannot verify the accuracy of these numbers. x = ispan(1,8,1) y = (/154900,56600,40000,30200,29700,24400,21700,13900/) labels = (/"Lung","Colon/rectum","Breast","Prostate","Pancreas",\ "Non-Hodgkin's~C~ Lymphoma","Leukemias","Ovary"/) colors = (/"FireBrick","Red","Orange","Green", "Navy", "Blue", \ "SkyBlue","SlateBlue"/) ;---Create the plot wks = gsn_open_wks("x11","poly3_ex03") res = True ; Plot mods desired res@gsnFrame = False ; Don't advance frame. res@gsnXYBarChart = True ; Turn on bar chart. res@gsnXYBarChartBarWidth = 0.75 ; Change bar widths res@gsnXYBarChartColors = colors res@tmXBOn = False ; Turn off tickmarks at bottom. res@trYMinF = 0 ; Bring bars down to zero. res@trYMaxF = 160000 res@trXMinF = 0 ; Add space on either end res@trXMaxF = 9 ; of the first and last bars. res@tiMainString = "Estimated Cancer Deaths for 2002" drawNDCGrid(wks) ; Draw an NDC grid to help w/placement of primitives. plot = gsn_csm_xy (wks,x,y,res) ; Draw plot, don't advance frame. ;---Set up info for box. width = 0.07 ; Box width height = 0.05 ; Box height xpos = 0.2 ; x,y position for ypos = 0.15 ; top left corner of box. xbox = (/xpos,xpos+width,xpos+width,xpos,xpos/) ybox = (/ypos,ypos,ypos-height,ypos-height,ypos/) ;---Line resources. lnres = True lnres@gsLineColor = "Firebrick" gsn_polyline_ndc(wks,xbox,ybox,lnres) frame(wks) end