; scatter_2.ncl ; ; Concepts illustrated: ; - Drawing a scatter plot ; - Changing the markers in an XY plot ; - Changing the marker color in an XY plot ; - Changing the marker size in an XY plot ; - Rotating markers in an XY plot ; - Creating your own markers for an XY plot ; - Generating dummy data using "random_normal" ; - Clipping markers outside the viewport ; ; *********************************************** load "/home/bliujuss/ncl/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "/home/bliujuss/ncl/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" load "/home/bliujuss/ncl/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "/home/bliujuss/ncl/lib/ncarg/nclscripts/csm/shea_util.ncl" load "/home/bliujuss/ncl/lib/ncarg/nclscripts/csm/contributed.ncl" ;************************************************ begin ;************************************************ ; Generate some random data ;************************************************ ;a = addfile("/home/bliujuss/Plots/work/g4.timeAvgMap.MOD08_M3_051_Optical_Depth_Land_And_Ocean_Mean_Mean.20060701-20060731.180W_90S_180E_90N.nc","r") ;c = addfile("/home/bliujuss/Plots/work/g4.timeAvgMap.MOD08_M3_051_Deep_Blue_Aerosol_Optical_Depth_550_Land_QA_Mean_Mean.20060701-20060731.180W_90S_180E_90N.nc","r") a = addfile("/home/bliujuss/Plots/work/July.nc","r") d = addfile("/home/bliujuss/Plots/FIM_Chem_Climo_Monthly_07.grib","r") var1 = a->MODIS var3 = a->DeepBlue var4 = d->VAR_147_GDS0_EATM_51 opt = False NLAT = 180 MLON = 360 LAT2 = latGlobeFo(NLAT, "LAT", "Latitude", "degrees_north") LON2 = lonGlobeFo(MLON, "LON", "Longitude", "degrees_east") X2x3 = area_conserve_remap_Wrap(var4&g0_lon_2, var4&g0_lat_1, var4(:,:), LON2, LAT2, opt) printVarSummary(var1) printVarSummary(X2x3) wks = gsn_open_wks ("x11","xy") ; open workstation res = True ; plot mods desired res@gsnMaximize = True ; maximize plot res@tiMainString = "AOD at Equator" res@tiXAxisString = "Longitude" res@tiYAxisString = "AOD 550nm" res@pmLegendDisplayMode = "Always" res@pmLegendSide = "Top" ; Change location of res@pmLegendParallelPosF = 0.90 ; move units right res@pmLegendOrthogonalPosF = -0.5 ; more neg = down res@pmLegendWidthF = 0.1 ; Change width and res@pmLegendHeightF = 0.1 ; height of legend. res@lgLabelFontHeightF = .01 ; change font height res@lgPerimOn = False ; no box around res@xyExplicitLegendLabels = (/"MODIS","Climo"/) res@xyLineThickness = (/1.0,2.0/) res@xyLineColors = (/"blue","red"/) ; add title res@xyMarkLineMode = "MarkLines" ; choose to use markers res@xyMarkers = (/1,1/) ; choose type of marker res@xyMonoLineThickness = True res@xyLineThicknessF = 3.0 tres = True ; plot mods desired tres@gsnMaximize = True ; maximize plot tres@tiMainString = "AOD at Equator" tres@tiXAxisString = "Longitude" tres@tiYAxisString = "AOD 550nm" tres@pmLegendDisplayMode = "Always" tres@pmLegendSide = "Top" ; Change location of tres@pmLegendParallelPosF = 0.85 ; move units right tres@pmLegendOrthogonalPosF = -0.5 ; more neg = down tres@pmLegendWidthF = 0.05 ; Change width and tres@pmLegendHeightF = 0.07 ; height of legend. tres@lgLabelFontHeightF = .008 ; change font height tres@lgPerimOn = False ; no box around tres@xyExplicitLegendLabels = (/"MODIS Deep Blue","Climo"/) tres@xyLineThickness = (/1.0,2.0/) tres@xyLineColors = (/"blue","red"/) ; add title tres@xyMarkLineMode = "MarkLines" ; choose to use markers tres@xyMarkers = (/1,1/) ; choose type of marker tres@xyMonoLineThickness = True tres@xyLineThicknessF = 3.0 pltres = True ; plot mods desired pltres@gsnMaximize = True ; maximize plot pltres@tiMainString = "AOD Bias at Equator" pltres@tiXAxisString = "Longitude" pltres@tiYAxisString = "AOD 550nm" pltres@pmLegendDisplayMode = "Always" pltres@pmLegendSide = "Top" ; Change location of pltres@pmLegendParallelPosF = 0.88 ; move units right pltres@pmLegendOrthogonalPosF = -0.5 ; more neg = down pltres@pmLegendWidthF = 0.05 ; Change width and pltres@pmLegendHeightF = 0.07 ; height of legend. pltres@lgLabelFontHeightF = .008 ; change font height pltres@lgPerimOn = False ; no box around pltres@xyExplicitLegendLabels = (/"MODIS Bias","MODIS Deep Blue Bias"/) pltres@xyLineThickness = (/1.0,2.0/) pltres@xyLineColors = (/"blue","red"/) ; add title pltres@xyMarkLineMode = "MarkLines" ; choose to use markers pltres@xyMarkers = (/1,1/) ; choose type of marker pltres@xyMonoLineThickness = True pltres@xyLineThicknessF = 3.0 sres = True sres@tiMainString = "Verification Data (Deep Blue)" sres@cnFillOn = True sres@gsnSpreadColors = True sres@gsnAddCyclic = False sres@gsnLeftString = "" sres@gsnRightString = "" sres@gsnCenterString = "" sres@tiXAxisString = "Aerosol Optical Depth 550nm" sres@cnLineLabelsOn = False sres@cnLineLabelBackgroundColor = "white" bias = X2x3(90,:)-var1(90,:) ;print(bias) bias2 = X2x3(90,:)-var3(90,:) data = new((/2,dimsizes(var1(90,:))/),double) data(0,:) = var1(90,:) data(1,:) = X2x3(90,:) deepblue = new((/2,dimsizes(var3(90,:))/),double) deepblue(0,:) = var3(90,:) deepblue(1,:) = X2x3(90,:) diff = new((/2,dimsizes(var1(90,:))/),double) diff(0,:) = bias diff(1,:) = bias2 plot = gsn_csm_y (wks,data,res) plot = gsn_csm_y (wks,deepblue,tres) plot = gsn_csm_y (wks,diff,pltres) plot = gsn_csm_contour_map_ce(wks,X2x3,sres) end