Color, Layout, and Annotations

In the previous lesson on making charts look better in Python, we learned some basic techniques and principles for making our plots more aesthetic. In this lesson, we'll focus more directly on customizing colors, line widths, layout, and annotations to make it easier for a viewer to extract insights from the charts. 

In other words, you'll learn data visualization and design best practices, as well as how to improve the accessibility of your visualization. To apply these new skills, we'll continue to use the same data set containing the percentage of bachelor's degrees granted to women from 1970 to 2012.

In this mission, you'll learn about RGB color model and how it can be used to set the line color. The RGB color model describes how the three primary colors (red, green, and blue) can be combined in different proportions to form any secondary color. The RGB color model is very familiar to people who work in photography, filmography, graphic design, and any field that use colors extensively. In computers, each RGB value can range between 0 and 255. This is because 256 integer values can be represented using 8 bits. 

In addition to learning about the RGB color model, you will also learn about setting the line width, annotating plots using matplotlib, and how to improve the layout and ordering of your visualization.


  • Learn to be mindful of your color choices.
  • Learn the importance of your data layout.
  • Learn when annotations can be used to provide additional context.

Mission Outline

1. Introduction
2. Color
3. Setting Line Color Using RGB
4. Setting Line Width
5. Improve the Layout and Ordering
6. Replacing the Legend With Annotations
7. Annotating in Matplotlib
8. Next Steps
9. Takeaways


Course Info:


The median completion time for this course is 6.5 hours. View Details

This course is requires a basic subscription. This course includes four missions and one guided project.  It is the fifth course in the Data Analyst in Python path and the Data Scientist in Python path.


Take a Look Inside

(function(d) { d.addEventListener("DOMContentLoaded", function() { var pathname = d.location.pathname.replace(/^[/]|[/]$/g, "").replace("/", "-"); var tags = d.getElementsByTagName("iframe"); var type = pathname.startsWith("course") ? "?course=" : pathname.startsWith("path") ? "?path=" : null; if (type) { var i; for (i = 0; i < tags.length; i++) { if (tags[i].src.indexOf("signup#iframe") !== -1) { tags[i].src = tags[i].src.replace("#iframe", "") + type + pathname + "#iframe"; } } } }, false); })(document);