Session Ready
Exercise

Line and Fill Color 2

Mapping a variable to the color attribute helps reveal more info through visual elements.In this exercise, you will play with rbokeh options to set colors and customize your figures.

You will use the Human Development Index (HDI) data published by the UNDP. The Human Development Index (HDI) is defined as "a summary measure of average achievement in key dimensions of human development: a long and healthy life, being knowledgeable and have a decent standard of living. The HDI is the geometric mean of normalized indices for each of the three dimensions." *

Note that:

  • dplyr and rbokeh packages are pre-loaded
  • hdi_data dataset is and available in this session
Instructions
100 XP
  • Extract the entries corresponding to "Namibia" and "Botswana" from hdi_data using filter() and assign the result to hdi_countries.
  • Plot human_development_index versus year using ly_lines().
  • In the ly_lines() layer, map country variable to the color.
  • In the ly_points()layer , map the country variable to the line_color argument and specify the fill_color as "white".