MulaiMulai sekarang secara gratis

Binning a scatterplot

The dataset vgsales contains 16450 cases (rows), which is large enough that binned scatterplots help avoid overplotting. In this exercise, your task is to create a binned scatterplot of User_Score against Critic_Score to display the entire dataset. (Recall up to now that you have only been displaying pieces of this dataset as scatterplots.)

Once you have created the plot, be sure to explore the interactivity. Specifically, note that the "z" entry in the hover info corresponds to the number of observations in the chosen bin.

plotly has already been loaded for you.

Latihan ini adalah bagian dari kursus

Interactive Data Visualization with plotly in R

Lihat Kursus

Petunjuk latihan

  • Create a binned scatterplot with Critic_Score on the x-axis and User_Score on the y-axis.
  • Set the number of bins on the x- and y-axes to 50.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Create a binned scatterplot of User_Score vs. Critic_Score
vgsales %>%
  plot_ly(___, ___) %>%
  ___(___, ___)
Edit dan Jalankan Kode