load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin y = random_uniform(-1.,1,(/100/)) ; Generate some random data. y2 = new((/4,100/),float,-999) ; ; Divide values by range they fall in, and then draw markers within ; a range with the same marker, color, and size. ; y2(0,ind(-1.0.le.y.and.y.lt.-0.5)) = y(ind(-1.0.le.y.and.y.lt.-0.5)) y2(1,ind(-0.5.le.y.and.y.lt. 0.0)) = y(ind(-0.5.le.y.and.y.lt. 0.0)) y2(2,ind( 0.0.le.y.and.y.lt. 0.5)) = y(ind( 0.0.le.y.and.y.lt. 0.5)) y2(3,ind( 0.5.le.y.and.y.lt. 1.0)) = y(ind( 0.5.le.y.and.y.lt. 1.0)) wks = gsn_open_wks ("x11","xy") res = True res@gsnMaximize = True ; ; Use plural resources to set different colors and sizes ; for each set of markers. ; res@xyMarkLineMode = "Markers" res@xyMarkers = (/ 3, 16, 13, 15/) res@xyMarkerSizes = (/ 0.01, 0.02, 0.022, 0.027/) res@xyMarkerColors = (/ "red", "orange", "green", "blue"/) plot = gsn_csm_y (wks,y2,res) end