;---------------------------------------------------------------------- ; This is a basic NCL template for creating vector plots. ; ; Use "vector_map_template.ncl" if you need to put the ; vectors over a map. ;---------------------------------------------------------------------- ; Note: as of NCL V6.2.0, you don't need these load commands ;---------------------------------------------------------------------- load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin ;---Read data filename = "file.nc" a = addfile(filename,"r") u = a->u v = a->v ;---Open workstation wks = gsn_open_wks("x11","vector") ; "ps", "pdf", "png" ;---Set some resources res = True res@gsnMaximize = True ; maximize plot in frame ;---Set these two if arrows are too short res@vcRefLengthF = some floating point value res@vcRefMagnitudeF = some floating point value res@vcMinFracLengthF = 0.05 ; length of min vector as fraction ; of reference vector. res@vcMinDistanceF = 0.02 ; "thin" vectors res@vcMonoLineArrowColor = False ; color arrows based on magnitude res@vcLevelPalette = "rainbow" ; define colormap for vectors res@vcGlyphStyle = "CurlyVector" ; turn on curly vectors res@tiMainString = "Data file is " + filename vector = gsn_csm_vector(wks,u,v,res) end