Merges two color maps to create a new color map for the given workstation.
Available in version 1.2.0 or later.
The identifier returned from calling Ngl.open_wks.cmap1, cmap2
This procedure merges two color maps into a single color map and sets it for the given workstation. The background/foreground colors will be retained from the first color map, and dropped from the second one. The two color maps must total 256 or fewer colors.
For a simple example of using Ngl.merge_colormaps to merge the "temp1" and "uniform" color maps, run the following Python script:
import Ngl wks = Ngl.open_wks("x11","example") Ngl.merge_colormaps(wks,"temp1","uniform") Ngl.draw_colormap(wks) Ngl.end()
For an example of merging a predefined color map with a set of RGB values, run the following Python script:
import Ngl,numpy wks = Ngl.open_wks("x11","example") cmap = numpy.array([[0.,0.,0.],[1.,1.,1.],[.1,.1,.1],[.2,.2,.2],[.3,.3,.3]]) Ngl.merge_colormaps(wks,"nrl_sirkes",cmap) Ngl.draw_colormap(wks) Ngl.end()For more examples, run the multi_plot.py script (see frame 1).