Colors

For the sake of consistency, the visualizations we produce should stick to a color scheme. Companies and academic institutions alike often have custom color palettes for presentations. We can easily adopt the same color palette in our visualizations too.

So far, we have either been providing colors to the color argument with their single character names, such as 'b' for blue and 'k' for black, or their names ('blue' or 'black'), but can we use different colors, such as seafoam green or crimson? Well, matplotlib has many colors that can be specified by name; these can be found in the documentation at https://matplotlib.org/examples/color/named_colors.html.

Remember that if we are providing a color with the style argument, we are limited ...

Get Hands-On Data Analysis with Pandas now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.