Creates a legend.
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" function gsn_create_legend ( wks  : graphic, nitems  : integer, labels [*] : string, res  : logical ) return_val  : graphic
The number of legend items you want.labels
An array of strings (of length nitems) containing the legend labels for each legend item.res
A variable containing an optional list of legend resources, attached as attributes. Set to True if you want the attached attributes to be applied, and False if you either don't have any resources to set, or you don't want the resources applied.
A scalar id of the legend created is returned. This is useful if you want to use gsn_add_annotation to attach the legend to a plot.
This function creates a legend, given the number of items and labels for each item and returns an id for the legend. Note that this function does not draw the legend. To do this, you must call draw and pass it the legend id created.
This function is similar to the procedure gsn_legend_ndc, except it returns the legend id.
For some application examples, see:
- Legends example 8