PyNGL Home > Functions > Graphics routines

Ngl.legend_ndc

Draws a legend anywhere in the viewport.

Prototype

pid = Ngl.legend_ndc(wks, nitems, labels,
                      x, y, res=None)

Arguments

wks

The identifier returned from calling Ngl.open_wks.

nitems

The number of legend items.

labels

An array of label strings for the legend.

x, y

The NDC values defining the coordinates of the upper left corner of the legend.

res=None

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

Return value

pid

A PlotId representing the legend created.

Description

This function creates and draws a legend on the given workstation. Legend resources can be set via the res variable.

See Also

Ngl.labelbar_ndc, Ngl.draw_ndc_grid

Legend resources

Examples

See legend.py (output).