I'm trying to understand how matplotlib colormaps work. Consider the following code:
import matplotlib.pyplot as plt
cmap = plt.get_cmap('jet')
print cmap(200)
which prints
(1.0, 0.46550472040668145, 0.0, 1.0)
So my understanding is that a colormap maps a numerical value (200 in this case) to a color value (1.0, 0.46550472040668145, 0.0, 1.0 in this case). How does matplotlib set the range for its colormap?
Is it possible to define a maximum and a minimum value between which a linear map is applied? With imshow() one can set a vmin and a vmax parameter, however, I would have to do it at the colormap level because I'm providing the colormap to another function later on.
This might be a more general question on how to colormaps work; in seaborn's color palettes, for example, there is no option for the range either.