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.
Cet exercice fait partie du cours
Interactive Data Visualization with plotly in R
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Create a scatterplot of User_Score vs. Critic_Score colored by User_Count
vgsales2016 %>%
plot_ly(x = ~Critic_Score, y = ~User_Score, ___) %>%
___