Adds a polygon to an existing plot.
pgon = Ngl.add_polygon(wks, plot, x, y, res=None)
The identifier returned from calling Ngl.open_wks.plot
The id of the plot which you want to add the polygon to.x, y
One-dimensional (masked) NumPy arrays or Python lists containing the x, y coordinates of the polygon.res=None
An (optional) instance of the Resources class having GraphicStyle resources as attributes.
A PlotId representing the polygon added.
This function adds a polygon to the requested plot. plot is the value returned from a previous call to one of the PyNGL plotting functions, like Ngl.xy, Ngl.contour_map, etc. x and y are 1-dimensional arrays (these can be Python lists or tuples, or NumPy arrays) defining the coordinates of the polygon, and resources can optionally contain an unlimited number of attributes that are GraphicStyle resource names and their values. Note that x and y must be in the same data space as the data in plot.
Note: unlike Ngl.polygon, this function does not actually draw the polygon. It only attaches a polygon to the given plot. You need to call Ngl.draw on plot in order to see the plot with the polygon added.
If you call this function multiple times, you should use a unique variable to hold the id returned.
There is no automatic handling of fill values. See the FAQ, How do I set a missing value for my data?