A colormap, or also called a colour look-up table (CLUT), is a mechanism used to transform a range of input colours into another range of colours. It can be a hardware device built into an imaging system or a software function built into an image processing application. The hardware colour look-up table will convert the logical colour (pseudo-colour) numbers stored in each pixel of video memory into physical colours, normally represented as RGB triplets, that can be displayed on a computer monitor. The palette is simply a block of fast RAM which is addressed by the logical colour and whose output is split into the red, green, and blue levels which drive the actual display (e.g., a CRT or cathode ray tube).
Usually to assert some color value to a variable value we retrieve the minimum and maximum of that variable and divide it by the number of colors available in the look up table (like an histogram). After that we know what color each value will have since all are separated by bins.
There are different colormaps depending on the expected purpose. There are colormaps for continuous variables and colormaps for discrete variables. There are colormaps that specifically divide the data into two populations around a center (like seismic or RdBu colormap: red,white,blue or reverse) among other objectives.
The matplotlib library has several available colormaps. The following code recipe adapted from here shows you some of the available matplotlib colormaps:
import numpy as np
import matplotlib.pyplot as plt
plt.rc('text', usetex=False)
a=np.outer(np.arange(0,1,0.01),np.ones(10))
plt.figure(figsize=(10,5))
plt.subplots_adjust(top=0.8,bottom=0.05,left=0.01,right=0.99)
maps=[m for m in plt.cm.datad if not m.endswith("_r")]
maps.sort()
l=len(maps)+1
for i, m in enumerate(maps):
plt.subplot(1,l,i+1)
plt.axis("off")
plt.imshow(a,aspect='auto',cmap=plt.get_cmap(m),origin="lower")
plt.title(m,rotation=90,fontsize=10)
plt.show()
The result should be similar to this:

The names of the colormaps are not always the same for each library. In fact there may be slight changes in the color dispersion for the same colormap in different libraries. Matplotlib has the seismic colormap. However mayavi has RdBu colormap for a very similar if not identical colormap. To check available mayavi colormaps you can do the following:
from mayavi.core import lut_manager
print lut_manager.lut_mode_list()
The result should be this:
['Accent', 'Blues', 'BrBG', 'BuGn', 'BuPu', 'Dark2', 'GnBu', 'Greens', 'Greys', 'OrRd', 'Oranges', 'PRGn', 'Paired', 'Pastel1', 'Pastel2', 'PiYG', 'PuBu', 'PuBuGn', 'PuOr', 'PuRd', 'Purples', 'RdBu', 'RdGy', 'RdPu', 'RdYlBu', 'RdYlGn', 'Reds', 'Set1', 'Set2', 'Set3', 'Spectral', 'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd', 'autumn', 'binary', 'black-white', 'blue-red', 'bone', 'cool', 'copper', 'file', 'flag', 'gist_earth', 'gist_gray', 'gist_heat', 'gist_ncar', 'gist_rainbow', 'gist_stern', 'gist_yarg', 'gray', 'hot', 'hsv', 'jet', 'pink', 'prism', 'spectral', 'spring', 'summer', 'winter']