Aan de slagGa gratis aan de slag

Adding to hoverinfo

During the video lesson, you learned how to fully customize the hover info displayed by plotly. This is a great approach, but what if you only want to quickly add an identifying column rather than polish your chart for publication on the web? This is possible by adding the text argument to the plot_ly() command without specifying hoverinfo = "text".

plotly has already been loaded for you.

Deze oefening maakt deel uit van de cursus

Interactive Data Visualization with plotly in R

Cursus bekijken

Oefeninstructies

  • Create a scatterplot of user score (User_Score) on the y-axis against critic score (Critic_Score) on the x-axis for video games sold in 2016.
  • Map the name of a video game (Name) to the text argument in the plot_ly() layer to add it to the hover info.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Create a scatterplot of User_Score vs. Critic score
vgsales2016 %>%
	# Add video game Name to the hover info text
	___ %>% 
	___
Code bewerken en uitvoeren