1 ; ***********************************************
2 ; combine 19.metric_plot.ncl and 24.lines.ncl
3 ; ***********************************************
4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl.test"
5 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl.test"
6 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
7 ;load "/fis/cgd/cseg/people/jeff/clamp/co2/metrics_table.ncl"
8 ;************************************************
12 plot_name = "table_zone"
13 wks = gsn_open_wks (plot_type,plot_name) ; open workstation
14 ;--------------------------------------------------------------
17 ;**********************************
19 table_header_name = "Zone"
21 ; column (not including header column)
22 col_header_zone = (/"Stations","Amplitude Ratio", \
23 "Correlation Coef","M score","Combined Score"/)
24 ncol_zone = dimsizes(col_header_zone )
26 ; row (not including header row)
27 row_header_zone = (/"60N-90N","30N-60N","EQ-30N","90S-EQ","Total"/)
28 nrow_zone = dimsizes(row_header_zone)
30 ; arrays to be passed to table.
31 value_zone = new ((/nrow_zone, ncol_zone/),string )
32 ;**********************************
34 table_length_zone = 0.4
37 ncr1 = (/1,1/) ; 1 row, 1 column
38 x1 = (/0.005,0.15/) ; Start and end X
39 y1 = (/0.900,0.995/) ; Start and end Y
40 text1 = table_header_name
42 res1@txFontHeightF = 0.03
43 res1@gsFillColor = "CornFlowerBlue"
45 ; Column header (equally space in x2)
46 ncr2 = (/1,ncol_zone/) ; 1 rows, 5 columns
47 x2 = (/x1(1),0.995/) ; start from end of x1
49 text2 = col_header_zone
51 res2@txFontHeightF = 0.015
52 res2@gsFillColor = "Gray"
54 ; Row header (equally space in y2)
55 ncr3 = (/nrow_zone,1/) ; 5 rows, 1 columns
57 y3 = (/1.0-table_length_zone,0.900/) ; end at start of y1
58 text3 = row_header_zone
60 res3@txFontHeightF = 0.02
61 res3@gsFillColor = "Gray"
64 ncr4 = (/nrow_zone,ncol_zone/) ; 5 rows, 5 columns
65 x4 = x2 ; Start and end x
66 y4 = y3 ; Start and end Y
67 text4 = new((/nrow_zone,ncol_zone/),string)
69 color_fill4 = new((/nrow_zone,ncol_zone/),string)
71 color_fill4(:,ncol_zone-1) = "grey"
73 res4 = True ; Set up resource list
74 ; res4@gsnDebug = True ; Useful to print NDC row,col values used.
75 res4@txFontHeightF = 0.02
76 res4@gsFillColor = color_fill4
80 ;**************************************************
82 ;**************************************************
84 text4 = sprintf("%5.2f", 0.9999 )
86 gsn_table(wks,ncr1,x1,y1,text1,res1)
87 gsn_table(wks,ncr2,x2,y2,text2,res2)
88 gsn_table(wks,ncr3,x3,y3,text3,res3)
89 gsn_table(wks,ncr4,x4,y4,text4,res4)