March 2014
Beginner to intermediate
222 pages
4h 7m
English
When using a lot of colors, defining each color one by one is tedious. Moreover, building a good set of colors is a problem in itself. In some cases, colormaps can address those issues. Colormaps define colors with a continuous function of one variable to one value, corresponding to one color. matplotlib provides several common colormaps; most of them are continuous color ramps. In this recipe, we are going to see how to color scatter plots with a colormap.
Colormaps are defined in the matplotib.cm module. This module provides functions to create and use colormaps. It also provides an exhaustive choice of predefined color maps.
The function pyplot.scatter() accepts a list of values for the color
Read now
Unlock full access