1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/npp/11.scatter.ncl Mon Jan 26 22:08:20 2009 -0500
1.3 @@ -0,0 +1,53 @@
1.4 +; ***********************************************
1.5 +; xy_4.ncl
1.6 +; ***********************************************
1.7 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
1.8 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
1.9 +;************************************************
1.10 +begin
1.11 +;************************************************
1.12 +; read in data
1.13 +;************************************************
1.14 +;f = addfile ("data.81.nc","r")
1.15 + f = addfile ("data.933.nc","r")
1.16 + x = f->SITE_ID ; get t data
1.17 +;y = f->PREC_ANN ; get t data
1.18 + y = f->TNPP_C ; get t data
1.19 +
1.20 + x@long_name = "SITE_ID"
1.21 +;y@long_name = "PREC_ANN"
1.22 + y@long_name = "TNPP_C"
1.23 +
1.24 +;************************************************
1.25 +; plotting parameters
1.26 +;************************************************
1.27 + wks = gsn_open_wks ("png","xy") ; open workstation
1.28 +
1.29 + res = True ; plot mods desired
1.30 +;res@tiMainString = "Observed 81 sites" ; add title
1.31 + res@tiMainString = "Observed 933 sites" ; add title
1.32 + res@xyMarkLineModes = "Markers" ; choose which have markers
1.33 + res@xyMarkers = 16 ; choose type of marker
1.34 + res@xyMarkerColor = "red" ; Marker color
1.35 + res@xyMarkerSizeF = 0.01 ; Marker size (default 0.01)
1.36 +
1.37 + res@tmLabelAutoStride = True ; nice tick mark labels
1.38 +
1.39 +;plot = gsn_csm_xy (wks,t&nvalues,t(:),res) ; create plot
1.40 + plot = gsn_csm_xy (wks,x,y,res) ; create plot
1.41 +
1.42 +;************************************************
1.43 +; now create our own markers using NhlNewMarker
1.44 +; available since ncl version 4.2.0.a030
1.45 +;************************************************
1.46 +; this example will create filled squares. You will have to play with
1.47 +; the numbers a but to get the size and shape you desire. On the
1.48 +; documentation page for NhlNewMarker, there is a table of values for
1.49 +; the current marker set, to give you an idea of where to start.
1.50 +
1.51 +; res@xyMarkerColor = "blue"
1.52 +; res@tiMainString = "Make your own marker"
1.53 +; res@xyMarkers = NhlNewMarker(wks, "^", 19, 0.0, 0.0, 1.3125, 1.5, 0.0)
1.54 +; plot = gsn_csm_xy (wks,x,y,res)
1.55 +
1.56 +end