PyNGL Home > Functions > Color routines

Ngl.retrieve_colormap

Retrieves the current color map associated with the given workstation.

Prototype

cmap = Ngl.retrieve_colormap(wks)

Arguments

wks

The identifier returned from calling Ngl.open_wks.

Return value

cmap

A 2-dimensional NumPy array.

Description

This function returns a 2-dimensional NumPy array dimensioned n x 3 having float values, where n is the number of colors in the color map, and the 3 represents the RGB values for each color.

See Also

Ngl.draw_colormap, Ngl.open_wks, Ngl.set_values

Examples

For an example of using Ngl.retrieve_colormap, run the color2.py script.