Animations are better than 3d plots!

Alejandro Borges Sanchez
Jun/24/2021

Are 3d plots or animation the best way to show time based data?

Using gapminder we can see two examples

  • A 3d plot that shows gdp per capita as a function of:
    • Time
    • Life Expectancy

3d Plot

library(gapminder); library(plotly); suppressWarnings(suppressMessages( library(tidyverse)));
gapminder%>%
    plot_ly()%>%
    plotly::add_markers(x=~year,y=~lifeExp,z = ~gdpPercap,color=~continent,
                        text=~country)

plot of chunk unnamed-chunk-1

Pros and cons

  • Pros:
    • Manipulation makes for a nice exploration experience.
  • Cons:
    • Its hard to make out the relationships over time

Time based animation

gapminder%>%
    plot_ly()%>%
    plotly::add_markers(frame=~year,
                        y=~lifeExp,
                        x = ~gdpPercap,
                        color=~continent,
                        text=~country)

plot of chunk unnamed-chunk-2

Pros and cons

  • Pros:
    • You can see countries “moving” in their relationship of two variables, thorugh time
  • Cons:
    • While looking at the presentation if you isolate continents, its hard to see interactions