load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin npts = 500 x = fspan(-100,100,npts) ; 500 values from -100 to 100. y = asciiread("xy2.txt",(/npts,4/),"float") y!0 = "npts" ; Name the dimensions for the sole y!1 = "ncurves" ; purpose of reordering them. y2 = y(ncurves|:,npts|:) ; Reorder dimensions to be 4 x 500. wks = gsn_open_wks ("x11","xy2_ex06") res = True ; Plot options desired. res@gsnMaximize = True ; Maximize plot in frame. res@xyMonoDashPattern = True ; Use one dash pattern (solid) res@xyLineThicknesses = (/1,2,3,4/) ; Line thicknesses res@xyLineColors = (/"NavyBlue","HotPink","OrangeRed","ForestGreen"/) res@trXMinF = min(x) ; Change limits of X and Y axes. res@trXMaxF = max(x) res@trYMinF = -500 res@trYMaxF = 1100 res@pmLegendDisplayMode = "Always" ; Turn on legend. res@xyExplicitLegendLabels = (/"one","two","three","four"/) res@pmLegendWidthF = 0.2 res@pmLegendHeightF = 0.1 res@pmLegendOrthogonalPosF = -0.28 res@pmLegendParallelPosF = 0.2 plot = gsn_csm_xy (wks,x,y2,res) ; Call the gsn_csm function ; for drawing the curves. end