There's more...
Previously, we have learned how to create discrete user-defined colormaps. Now let's see how to create user-defined continuous colormaps. The difference is in the color specification. In discrete colormaps, we will have as many RGB tuples as the number of clusters we have in data, so that each color represents one cluster. However, in continuous colormaps, the color has to move gradually from one end of the spectrum to the other, along the complete data range.
As we know, each color is represented with a tuple of three numbers: R, G, and B channels. In some cases, the fourth channel, alpha, is also used to represent the transparency (or opaqueness) of the colors. Here is how we need to specify the colors. Let's take an example: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access