1. Learn
  2. /
  3. Courses
  4. /
  5. Interactive Data Visualization with Bokeh

Exercise

Free throw percentage by position

The agency has asked for one final plot from you. You'll use factor_cmap to build a scatter plot visualizing free throw percentage versus average points, displaying each player position as a different color.

A source object called source has been created from the nba dataset and preloaded for you. The variable TOOLTIPS, containing the name of the player, has also been created, so it can be viewed when hovering the mouse over the plot.

Instructions

100 XP
  • Import Category10_5 and factor_cmap.
  • Create positions, a list containing "PG", "SG", "SF", "PF", and "C".
  • Pass "position" to the legend_field argument and complete the fill_color argument within fig.circle().