Draws a filled polygon on the given plot.
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" procedure gsn_polygon ( wks  : graphic, plot  : graphic, x [*] : numeric, y [*] : numeric, res  : logical )
One-dimensional arrays of the same length containing the X and Y coordinates of the polygon, and must be in the range of the X/Y coordinates of the data in plot. If drawing the polygon on a map, then X should correspond to longitude values, and Y to latitude values.res
A variable containing an optional list of polygon 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.
If a missing value is encountered in x and/or y, then this pair is ignored (the polygon will still be closed).
There are many fill patterns available, and you can use the gsFillIndex resource to change the fill pattern. The default is a solid fill. You can change the color of the fill via the gsFillColor resource.
If you want to resize the plot (i.e., by passing the plot to gsn_panel or setting the vpWidthF or vpHeightF resources), then use the function gsn_add_polygon. This will cause the polygon to be attached to the given plot, and hence automatically resized when the plot is resized.
Previously, drawing a polyline around the equator, for example, could be specified using 2-element arrays. For example:
lnid = gsn_add_polyline(wks,map,(/0,360/),(/0,0/),lnres)Now, however, in order to eliminate a number of ambiguous situations and to make user code simpler in most cases, a new behavior has been introduced: the line between two points on the globe always follows the shortest path. In the example above, the behavior in NCL V6.2.0 leads to a 0-length line. The recommended approach now for drawing a line around the equator is to use four points, such that the distance from one to the next is always less than 180 degrees. For example:
lnid = gsn_add_polyline(wks,map,(/0,120,240,360/),(/0,0,0,0/),lnres)
gsn_polymarker, gsn_polyline, gsn_polygon_ndc, gsn_polymarker_ndc, gsn_polyline_ndc, gsn_add_polygon, gsn_add_polymarker, gsn_add_polyline, gsn_text, gsn_text_ndc, gsn_add_text, gsn_add_shapefile_polylines, gsn_add_shapefile_polymarkers, gsn_add_shapefile_polygons, NhlNewMarker, NhlNewDashPattern
For some application examples, see:
Also, see the suite of polygon examples.