1. Learn
  2. /
  3. Courses
  4. /
  5. Interactive Data Visualization with plotly in R

Exercise

Transforming a color scale

When mapping a numeric variable to color, sometimes it is necessary to transform the variable. This is especially true if the variable values differ by an order of magnitude or more.

In this exercise, you will explore how the number of users helps explain the relationship between user and critic scores for video games in 2016. Additionally, you will explore how applying the natural log can help make a color scale more interpretable.

plotly has already been loaded for you and the data are stored in the vgsales2016 object.

Instructions 1/2

undefined XP
  • 1

    Create a scatterplot of User_Score against Critic_Score, where color represents User_Count.

  • 2

    Recreate the scatterplot of user score against critic score, but have color represent the natural log of user count.