forrest@0: ; *********************************************** forrest@0: ; combine 19.metric_plot.ncl and 24.lines.ncl forrest@0: ; *********************************************** forrest@0: load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl.test" forrest@0: load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl.test" forrest@0: load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" forrest@0: ;load "/fis/cgd/cseg/people/jeff/clamp/co2/metrics_table.ncl" forrest@0: ;************************************************ forrest@0: begin forrest@0: forrest@0: plot_type ="ps" forrest@0: plot_name = "table_zone" forrest@0: wks = gsn_open_wks (plot_type,plot_name) ; open workstation forrest@0: ;-------------------------------------------------------------- forrest@0: ; for zone table forrest@0: forrest@0: ;********************************** forrest@0: ; table header name forrest@0: table_header_name = "Zone" forrest@0: forrest@0: ; column (not including header column) forrest@0: col_header_zone = (/"Stations","Amplitude Ratio", \ forrest@0: "Correlation Coef","M score","Combined Score"/) forrest@0: ncol_zone = dimsizes(col_header_zone ) forrest@0: forrest@0: ; row (not including header row) forrest@0: row_header_zone = (/"60N-90N","30N-60N","EQ-30N","90S-EQ","Total"/) forrest@0: nrow_zone = dimsizes(row_header_zone) forrest@0: forrest@0: ; arrays to be passed to table. forrest@0: value_zone = new ((/nrow_zone, ncol_zone/),string ) forrest@0: ;********************************** forrest@0: forrest@0: table_length_zone = 0.4 forrest@0: forrest@0: ; Table header forrest@0: ncr1 = (/1,1/) ; 1 row, 1 column forrest@0: x1 = (/0.005,0.15/) ; Start and end X forrest@0: y1 = (/0.900,0.995/) ; Start and end Y forrest@0: text1 = table_header_name forrest@0: res1 = True forrest@0: res1@txFontHeightF = 0.03 forrest@0: res1@gsFillColor = "CornFlowerBlue" forrest@0: forrest@0: ; Column header (equally space in x2) forrest@0: ncr2 = (/1,ncol_zone/) ; 1 rows, 5 columns forrest@0: x2 = (/x1(1),0.995/) ; start from end of x1 forrest@0: y2 = y1 ; same as y1 forrest@0: text2 = col_header_zone forrest@0: res2 = True forrest@0: res2@txFontHeightF = 0.015 forrest@0: res2@gsFillColor = "Gray" forrest@0: forrest@0: ; Row header (equally space in y2) forrest@0: ncr3 = (/nrow_zone,1/) ; 5 rows, 1 columns forrest@0: x3 = x1 ; same as x1 forrest@0: y3 = (/1.0-table_length_zone,0.900/) ; end at start of y1 forrest@0: text3 = row_header_zone forrest@0: res3 = True forrest@0: res3@txFontHeightF = 0.02 forrest@0: res3@gsFillColor = "Gray" forrest@0: forrest@0: ; Main table body forrest@0: ncr4 = (/nrow_zone,ncol_zone/) ; 5 rows, 5 columns forrest@0: x4 = x2 ; Start and end x forrest@0: y4 = y3 ; Start and end Y forrest@0: text4 = new((/nrow_zone,ncol_zone/),string) forrest@0: forrest@0: color_fill4 = new((/nrow_zone,ncol_zone/),string) forrest@0: color_fill4 = "white" forrest@0: color_fill4(:,ncol_zone-1) = "grey" forrest@0: forrest@0: res4 = True ; Set up resource list forrest@0: ; res4@gsnDebug = True ; Useful to print NDC row,col values used. forrest@0: res4@txFontHeightF = 0.02 forrest@0: res4@gsFillColor = color_fill4 forrest@0: forrest@0: delete (color_fill4) forrest@0: forrest@0: ;************************************************** forrest@0: ; plot zone table forrest@0: ;************************************************** forrest@0: forrest@0: text4 = sprintf("%5.2f", 0.9999 ) forrest@0: forrest@0: gsn_table(wks,ncr1,x1,y1,text1,res1) forrest@0: gsn_table(wks,ncr2,x2,y2,text2,res2) forrest@0: gsn_table(wks,ncr3,x3,y3,text3,res3) forrest@0: gsn_table(wks,ncr4,x4,y4,text4,res4) forrest@0: forrest@0: frame(wks) forrest@0: forrest@0: end