Get startedGet started for free

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.

This exercise is part of the course

Interactive Data Visualization with plotly in R

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Create a scatterplot of User_Score vs. Critic_Score colored by User_Count
vgsales2016 %>%
  plot_ly(x = ~Critic_Score, y = ~User_Score, ___) %>%
  ___
Edit and Run Code