Ngl.text
Draws text strings on an existing plot.
Prototype
txt = Ngl.text(wks, plot, text, x, y, res=None)
Arguments
wksThe identifier returned from calling Ngl.open_wks.
plotThe id of the plot which you want to draw the text strings on.
textAn array of text strings.
x, yOne-dimensional arrays containing the x, y coordinates of the text strings.
res=NoneAn optional variable containing a list of TextItem resources, attached as attributes.
Return value
txtA PlotId of the text object created.
Description
This function draws text strings on the given 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 text strings, and resources can optionally contain an unlimited number of attributes that are resource names and their values. Note that x and y must be in the same data space as the data in plot.
The frame is not advanced when you call this function, so you need to call Ngl.frame yourself if you want to advance the frame.
If you plan to resize your plot or use it in a call to Ngl.panel, then it is better to use the function Ngl.add_text. With this function, the text strings are attached to the plot and will automatically get resized when the plot is resized.
Missing values are not allowed in this procedure.
See Also
Examples
See examples ngl07p.py (output) and ngl10p.py (output).