;********************************************* ; leg_20.ncl ; ; Concepts illustrated: ; - Manually creating a legend using simple_legend_ndc ;********************************************* ; ; These files are loaded by default in NCL V6.2.0 and newer ; 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" ;********************************************* wks = gsn_open_wks("png","leg") res = True res@gsnFrame = False plot = gsn_csm_xy(wks,ispan(1,10,1),fspan(1,5,10),res) gres = True gres@YPosPercent = 95. ; expressed as %, 0->100, sets position of top border of legend ; when gres@Position is set to its default setting of "Top" (Default = 95.) gres@XPosPercent = 50. ; expressed as %, 0->100, sets position of left border of legend(Default = 5.) lineres = True lineres@lgLineColors = (/"red","orange","dodgerblue"/) ; line colors lineres@lgLineThicknesses = 5 ; line thicknesses lineres@LineLengthPercent = 18. ; expressed as %, 0->100, length of line textres = True textres@lgLabels = (/"CESM1 50","CESM1 52","CESM1 55"/) ; legend labels (required) simple_legend_ndc(wks,gres,lineres,textres) frame(wks)