load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" ; ============================================================== ; User defined parameters ; ============================================================== begin nrows=100 ncols=2 y1 =asciiread("IND_res.txt",(/4600/),"float") y2 =asciiread("NAF_res.txt",(/4403/),"float") y3 =asciiread("SAF_res.txt",(/10293/),"float") x1 =asciiread("IND_s.txt",(/4600/),"float") x2 =asciiread("NAF_s.txt",(/4403/),"float") x3 =asciiread("SAF_s.txt",(/10293/),"float") ;=========Generate some levels to group the data values======= levels = ispan(0,4600,500) printVarSummary(levels) nlevels = dimsizes(levels) nlevelsm1 = nlevels-1 ;================================================= wks = gsn_open_wks("pdf","scatter2") ; gsn_define_colormap(wks,"CBR_coldhot") dum_fill_trn = new(nlevelsm1,graphic) res =True res@gsnDraw = False res@gsnFrame = False res@gsnMaximize = True ; maximize plot res@tiMainString = "Scatter Plot" ; add title res@gsnMaximize = True ; maximize plot res@tiMainString = "LAND Scatter Plot" ; add title ;============= resources for tickmark labels=============== res@tmXBMode="Explicit" res@tmXBValues=(/1,2,3,4,5,6,7,8,9,10,11,12/) res@tmXBLabels=(/1,2,3,4,5,6,7,8,9,10,11,12/) res@xyMarkLineMode = "Markers" ; choose to use markers ;res@xyMarkers = 1 ; choose type of marker res@xyMarkerColor = "red" ; Marker color res@xyMarkerSizeF = 0.1 res@trYMinF=0.0 res@trXMinF=0.5 res@trYMaxF=14.0 res@trXMaxF=12.5 ; res@gsMarkerSizeF = 0.015 ; res@xyMarkerColor = "blue" res@xyMarkers = NhlNewMarker(wks, "y", 35, 0.0, 0.0, 1., 0.5, 0.) ; res@xyMarkers = NhlNewMarker(wks, "^", 19, 0.0, 0.0, 1.2, 0.5, 0.0) plot1 = gsn_csm_xy (wks,x1,y1,res) ; create plot draw(plot1) res@xyMarkerColor = "blue" ; Marker color res@gsMarkerOpacityF = 0.70 plot2 = gsn_csm_xy (wks,x2,y2,res) ; create plot draw(plot2) res@xyMarkerColor = "orange" ; Marker color ;plot3 = gsn_csm_xy (wks,x3,y3,res) ; create plot ;draw(plot3) frame(wks) end