Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Interactive Data Visualization with plotly in R

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

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