Skip to content
Plotly templates

Animated Bubble Chart (Gapminder-style)

Life expectancy vs GDP per capita with frame-by-frame animation.

Template previewPlotly
Rendering…

Make it your own.

{
  "data": [{
    "type":"scatter","mode":"markers",
    "x":[1000,3000,8000,15000,25000,40000],
    "y":[55,62,68,73,78,82],
    "text":["Country A","Country B","Country C","Country D","Country E","Country F"],
    "marker":{"size":[18,24,30,36,42,48],"color":["#dc2626","#f59e0b","#16a34a","#0ea5e9","#7c3aed","#ec4899"]}
  }],
  "layout":{
    "title":"Life expectancy vs GDP per capita",
    "xaxis":{"title":"GDP per capita ($)","type":"log"},
    "yaxis":{"title":"Life expectancy (years)","range":[50,85]},
    "updatemenus":[{
      "type":"buttons",
      "buttons":[{"label":"Play","method":"animate","args":[null]}]
    }]
  }
}