npp/11.scatter.ncl
changeset 0 0c6405ab2ff4
equal deleted inserted replaced
-1:000000000000 0:083fd957ddf2
       
     1 ; ***********************************************
       
     2 ; xy_4.ncl
       
     3 ; ***********************************************
       
     4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
       
     5 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
       
     6 ;************************************************
       
     7 begin
       
     8 ;************************************************
       
     9 ; read in data
       
    10 ;************************************************
       
    11 ;f     = addfile ("data.81.nc","r")
       
    12  f     = addfile ("data.933.nc","r")
       
    13  x     = f->SITE_ID                               ; get t data
       
    14 ;y     = f->PREC_ANN                              ; get t data
       
    15  y     = f->TNPP_C                                ; get t data
       
    16  
       
    17  x@long_name = "SITE_ID"
       
    18 ;y@long_name = "PREC_ANN"
       
    19  y@long_name = "TNPP_C"
       
    20  
       
    21 ;************************************************
       
    22 ; plotting parameters
       
    23 ;************************************************
       
    24  wks   = gsn_open_wks ("png","xy")                 ; open workstation
       
    25 
       
    26  res                   = True                     ; plot mods desired
       
    27 ;res@tiMainString      = "Observed 81 sites"            ; add title
       
    28  res@tiMainString      = "Observed 933 sites"           ; add title
       
    29  res@xyMarkLineModes   = "Markers"                ; choose which have markers
       
    30  res@xyMarkers         =  16                      ; choose type of marker  
       
    31  res@xyMarkerColor     = "red"                    ; Marker color
       
    32  res@xyMarkerSizeF     = 0.01                     ; Marker size (default 0.01)
       
    33 
       
    34  res@tmLabelAutoStride = True                     ; nice tick mark labels
       
    35 
       
    36 ;plot  = gsn_csm_xy (wks,t&nvalues,t(:),res) ; create plot
       
    37  plot  = gsn_csm_xy (wks,x,y,res) ; create plot
       
    38 
       
    39 ;************************************************
       
    40 ; now create our own markers using NhlNewMarker 
       
    41 ; available since ncl version 4.2.0.a030
       
    42 ;************************************************
       
    43 ; this example will create filled squares. You will have to play with
       
    44 ; the numbers a but to get the size and shape you desire. On the
       
    45 ; documentation page for NhlNewMarker, there is a table of values for
       
    46 ; the current marker set, to give you an idea of where to start.
       
    47 
       
    48 ; res@xyMarkerColor = "blue"
       
    49 ; res@tiMainString  = "Make your own marker"
       
    50 ; res@xyMarkers     = NhlNewMarker(wks, "^", 19, 0.0, 0.0, 1.3125, 1.5, 0.0)
       
    51 ; plot              = gsn_csm_xy (wks,x,y,res) 
       
    52 
       
    53 end