Home > Uncategorized > Balloons and Bubbles

Balloons and Bubbles

I have seen a number of enjoyable presentations with animated bubble charts or plots and just wanted to play with this idea. This toy and meaningless example is a start.

The data:


ausb = WolframAlpha[
"birth rate Australia 1970 to 2010", \
{{"History:AnnualBirths:CountryData", 1}, "TimeSeriesData"}];
ausd = WolframAlpha[
"death rate Australia 1970 to 2010", \
{{"History:AnnualDeaths:CountryData", 1}, "TimeSeriesData"}];
ausp = WolframAlpha[
"population Australia 1970 to 2010", \
{{"SensiblePlot:Population:CountryData", 1}, "TimeSeriesData"}];
germb = WolframAlpha[
"birth rate Germany 1970 to 2010", \
{{"History:AnnualBirths:CountryData", 1}, "TimeSeriesData"}];
germd = WolframAlpha[
"death rate Germany 1970 to 2010", \
{{"History:AnnualDeaths:CountryData", 1}, "TimeSeriesData"}];
germp = WolframAlpha[
"population Germany 1970 to 2010", \
{{"SensiblePlot:Population:CountryData", 1}, "TimeSeriesData"}];

The plot:


all = Select[
GatherBy[ Join[ausb, ausd, ausp[[1]], germb, germd, germp[[1]]],
First], Length[#] == 6 &];
yrs = all[[All, 1, 1, 1]];
ListAnimate[
MapThread[
BubbleChart[List /@ #1, PlotRange -> {{0, 2000000}, {0, 1000000}},
ChartLegends -> {"Australia", "Germany"},
FrameLabel -> {"Annual births", "Annual deaths"}, PlotLabel -> #2,
BaseStyle -> 12,
Epilog -> {Dashed,
Line[{{0, 0}, {2000000,
2000000}}]}] &, {({{#1[[2, 1]], #2[[2, 1]], #3[[2,
1]]}, {#4[[2, 1]], #5[[2, 1]], #6[[2, 1]]}} & @@@ all),
yrs}]]

The result:

bp

I derived some amusement that the “rapid drop” in annual births below “annual deaths” for Germany was associated with a slow “deflation” of the population “balloon”/bubble.

 

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: