PyNGL Home > Functions > Graphics routines

Ngl.labelbar_ndc

Draws a labelbar anywhere in the viewport.

Prototype

pid = Ngl.labelbar_ndc(wks, nboxes, labels, 
                        x, y, res=None)

Arguments

wks

The identifier returned from calling Ngl.open_wks.

nboxes

The number of labelbar boxes.

labels

An array of label strings for the labelbar boxes.

x, y

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

res=None

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

Return value

pid

A PlotId representing the labelbar created.

Description

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

Note that some of the plotting routines, like Ngl.contour, will automatically generate a labelbar for you if color fill is turned on. This function is mostly useful if you need to generate additional labelbars, or if you need a more specialized labelbar than the automatic one that is created.

See Also

Ngl.legend_ndc, Ngl.draw_ndc_grid

Labelbar resources

Examples

See labelbar.py (output).