Application Center - Maplesoft

App Preview:

Visualizing Multiple Datasets with BubblePlot

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application




Visualizing Multiple Datasets with BubblePlot

The BubblePlot  command can convey information about three dimensions of a multi-dimensional dataset using the horizontal axis, the vertical axis, and point (bubble) size. Moreover, if a dataset is a time series , BubblePlot can generate an animation that shows the movement of data points over a common period of time.

 

In the following example, datasets containing information on Gross Domestic Product at Power Purchasing Parity, Life Expectancy, and Population are retrieved for selected countries and visualized.

 

To begin, the DataSets  and Statistics  packages are loaded.

with(DataSets); with(Statistics)

 

List of countries with their 3-letter country codes.

 

List of Countries

 

The next three steps create Vectors containing datasets on GDP at PPP, Life Expectancy, and Population for each of the countries in the code edit region above. We can make use of the fact many data sources use a standardized 3-letter country code to represent a specific country while building the unique identifier for each dataset.

Note: This example downloads data for 540 datasets. This may take some time. It is possible to view the cached animation below without loading any data by clicking on the plot and using the animation toolbar controls.

 

Gross Domestic Product at Power Purchasing Parity
Source: Open Data for Africa

ds1 := Vector([`~`[proc (x) options operator, arrow; Reference("quandl", cat("ODA/", x, "_PPPPC")) end proc]([entries(Countries, nolist, indexorder)])])


Life Expectancy
Source: Worldbank

ds2 := Vector([`~`[proc (x) options operator, arrow; Reference("quandl", cat("WORLDBANK/", x, "_SP_DYN_LE00_IN")) end proc]([entries(Countries, nolist, indexorder)])])


Population
Source: Worldbank

ds3 := Vector([`~`[proc (x) options operator, arrow; Reference("quandl", cat("WORLDBANK/", x, "_SP_POP_TOTL")) end proc]([entries(Countries, nolist, indexorder)])])

 

The following is an animated BubblePlot of GDP at PPP vs Life Expectancy, where bubble sizes correspond to the population of listed countries. The current year can be seen below the legend. To play back the animation, click on the plot and use the animation toolbar controls.

BubblePlot(ds1, ds2, ds3, data_legend = ["GDP at PPP", "Life Expectancy", "Population"], bubble_legend = [indices(Countries, nolist, indexorder)], frames = 50, size = [1400, 1100], gridlines, font = ["Calibri", 14])

 

Sample References

 

All of the above datasets are taken from the online data aggregator Quandl. Each dataset has a unique identifier. A sample for each of the three topic areas: GDP at PPP, Life Expectancy, and Population is listed below:

Canada Per Capita GDP based on PPP Valuation, USD

Canada: Life expectancy at birth, total (years)

Canada: Population, total