PyNGL Home > Functions > Graphics routines

Ngl.text_ndc

Draws text strings on the viewport.

Prototype

txt = Ngl.text_ndc(wks, text, x, y, res=None)

Arguments

wks

The identifier returned from calling Ngl.open_wks.

text

An array of text strings.

x, y

Scalars, one-dimensional NumPy arrays, or Python lists containing the x, y NDC coordinates of the text strings.

res=None

An (optional) instance of the Resources class having TextItem resources as attributes.

Return value

txt

A PlotId of the text object created.

Description

This procedure draws text strings on the viewport of the requested workstation. x and y are 1-dimensional arrays (these can be Python lists or tuples, or NumPy arrays) defining the coordinates of the text in NDC space, and resources can optionally contain an unlimited number of attributes that are resource names and their values.

The frame is not advanced when you call this procedure, so you need to call Ngl.frame yourself if you want to advance the frame.

Missing values are not allowed in this procedure.

See Also

Ngl.text, Ngl.add_text, Ngl.draw_ndc_grid

Examples

See examples ngl05p.py (output), ngl07p.py (output), and ngl11p.py (output).