; ; Note: This example will not run with Version 4.1 or earlier of NCL. ; If you are licensed for version 4.1 of NCAR Graphics and are ; interested in getting a *test* version of NCL that will work with ; this example, send email to ncargfx@ucar.edu. ; ; This example makes use of the GSUN functions and procedures for ; generating graphics. If you would like more information on GSUN, ; go to the URL: http://ngwww.ucar.edu/ngdoc/ng/ug/ncl/gsun/ ; load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl" ; Load the NCL file ; that contains the gsn_* ; functions used below. begin npts = 64 x = ispan(1,npts,1) ; Generate integers from 1 to 64. y = new((/3,npts/),float) ; Create a 3 x npts float array. y(0,:) = sin(ispan(0,npts-1,1)*6.28/npts) ; Define three sine curves. y(1,:) = y(0,:) + 1.0 y(2,:) = y(0,:) + 2.0 wks = gsn_open_wks("x11","example2") ; Open an X11 window. xyres = True ; Variable to hold XY plot resources. colors = (/"Magenta","DarkOrange","GreenYellow"/) ; Colors for each curve. xyres@xyLineColors = colors ; curve colors xyres@xyLabelMode = "Custom" ; label each curve with a text string xyres@xyExplicitLabels = colors ; text string labels for each curve plot = gsn_xy(wks,x,y,xyres) ; Draw XY plot with three curves. ; Frame is automatically advanced ; by gsn_xy. end