Session Ready
Exercise

Factors as frames

Time is not the only type of variable that can be used to specify the frames of an animation. You can also create an animation that cycles through subplots created by factors rather than using a grid layout.

In this exercise, you will adapt your answer from the previous question to create an animation that cycles through bubble charts for each region in 2017.

Note: The default settings for the animation make it go very quickly. In the next lesson, you'll learn how to adjust the speed. For now, you can use the slider bar to navigate between regions if you want to investigate the relationships.

plotly and the us_economy data set have already been loaded.

Instructions
100 XP

Complete the code to animate a bubble chart of house_price against gdp across regions of the U.S. Specifically,

  • filter out the data for 2017,
  • and change the appropriate aesthetic to allow region to define each snapshot in the animation.