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 lesson, 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.

Lesson 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