generate bubble plots - Maple Help

Home : Support : Online Help : Graphics : Statistics : Statistics/BubblePlot

Statistics[BubblePlot] - generate bubble plots

 Calling Sequence BubblePlot(X, Y, Z, plotoptions) BubblePlot['interactive'](X, Y, Z)

Parameters

 X - first data sample Y - second data sample Z - third data sample plotoptions - options to be passed to the plots[display] command

Description

 • The BubblePlot command generates a bubble plot for the specified data. The center of each bubble is defined by the values of the corresponding points in the first and the second data sets. The size of the bubbles is proportionate to the magnitude of the corresponding point in the third data set. Filled bubbles represent positive values.
 • The first parameter X is the first data sample - given as a Vector for example.
 • The second parameter Y is the second data sample - given as a Vector for example.
 • The third parameter Z is the third data sample - given as a Vector for example. Note, that X, Y, and Z must have the same number of elements.
 • If the parameters X, Y, and Z all contain time series data (either time series objects or time series references), an animated plot will be generated by default, where the corresponding time series will define the position and size of the bubbles over time. This will not work with the ['interactive'] option.
 • If the ['interactive'] option is used, a dialog box appears that allows for customized creation of the plot.

Examples

 > $\mathrm{with}\left(\mathrm{Statistics}\right):$
 > $X:=⟨1,2,3,4,5,6,7,8,9,9⟩:$
 > $Y:=⟨1,4,2,3,3,1,5,1,5,5⟩:$
 > $Z:=⟨5,2,-3,-4,5,2,-1,2,1,1⟩:$

This is the command to create the plot from the Plotting Guide using the data above.

 > $\mathrm{BubblePlot}\left(X,Y,Z\right)$

Use time series data to create animated plots. Compare the GDP, industry share of GDP, and services share of GDP of a few countries.

 > $\mathrm{with}\left(\mathrm{DataSets}\right):$
 > $\mathrm{ds1}:=\mathrm{Vector}\left(\left[\mathrm{Reference}\left("quandl","WORLDBANK/USA_NV_SRV_TETC_ZS"\right),\mathrm{Reference}\left("quandl","WORLDBANK/CAN_NV_SRV_TETC_ZS"\right),\mathrm{Reference}\left("quandl","WORLDBANK/DEU_NV_SRV_TETC_ZS"\right),\mathrm{Reference}\left("quandl","WORLDBANK/JPN_NV_SRV_TETC_ZS"\right)\right]\right)$
 ${\mathrm{ds1}}{:=}\left[\begin{array}{c}\left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{United States: Services, etc., value added \left(% of GDP\right)}}\\ {\mathrm{Quandl WORLDBANK/USA_NV_SRV_TETC_ZS}}\\ {\mathrm{up to 42 rows \left(annual\right), 1 column}}\\ {\mathrm{1970-12-31 - 2011-12-31}}\end{array}\right]\\ \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Canada: Services, etc., value added \left(% of GDP\right)}}\\ {\mathrm{Quandl WORLDBANK/CAN_NV_SRV_TETC_ZS}}\\ {\mathrm{up to 41 rows \left(annual\right), 1 column}}\\ {\mathrm{1970-12-31 - 2010-12-31}}\end{array}\right]\\ \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Germany: Services, etc., value added \left(% of GDP\right)}}\\ {\mathrm{Quandl WORLDBANK/DEU_NV_SRV_TETC_ZS}}\\ {\mathrm{up to 41 rows \left(annual\right), 1 column}}\\ {\mathrm{1970-12-31 - 2010-12-31}}\end{array}\right]\\ \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Japan: Services, etc., value added \left(% of GDP\right)}}\\ {\mathrm{Quandl WORLDBANK/JPN_NV_SRV_TETC_ZS}}\\ {\mathrm{up to 43 rows \left(annual\right), 1 column}}\\ {\mathrm{1970-12-31 - 2012-12-31}}\end{array}\right]\end{array}\right]$ (1)
 > $\mathrm{ds2}:=\mathrm{Vector}\left(\left[\mathrm{Reference}\left("quandl","WORLDBANK/USA_NV_IND_TOTL_ZS"\right),\mathrm{Reference}\left("quandl","WORLDBANK/CAN_NV_IND_TOTL_ZS"\right),\mathrm{Reference}\left("quandl","WORLDBANK/DEU_NV_IND_TOTL_ZS"\right),\mathrm{Reference}\left("quandl","WORLDBANK/JPN_NV_IND_TOTL_ZS"\right)\right]\right)$
 ${\mathrm{ds2}}{:=}\left[\begin{array}{c}\left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{United States: Industry, value added \left(% of GDP\right)}}\\ {\mathrm{Quandl WORLDBANK/USA_NV_IND_TOTL_ZS}}\\ {\mathrm{up to 42 rows \left(annual\right), 1 column}}\\ {\mathrm{1970-12-31 - 2011-12-31}}\end{array}\right]\\ \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Canada: Industry, value added \left(% of GDP\right)}}\\ {\mathrm{Quandl WORLDBANK/CAN_NV_IND_TOTL_ZS}}\\ {\mathrm{up to 41 rows \left(annual\right), 1 column}}\\ {\mathrm{1970-12-31 - 2010-12-31}}\end{array}\right]\\ \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Germany: Industry, value added \left(% of GDP\right)}}\\ {\mathrm{Quandl WORLDBANK/DEU_NV_IND_TOTL_ZS}}\\ {\mathrm{up to 44 rows \left(annual\right), 1 column}}\\ {\mathrm{1970-12-31 - 2013-12-31}}\end{array}\right]\\ \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Japan: Industry, value added \left(% of GDP\right)}}\\ {\mathrm{Quandl WORLDBANK/JPN_NV_IND_TOTL_ZS}}\\ {\mathrm{up to 43 rows \left(annual\right), 1 column}}\\ {\mathrm{1970-12-31 - 2012-12-31}}\end{array}\right]\end{array}\right]$ (2)
 > $\mathrm{ds3}:=\mathrm{Vector}\left(\left[\mathrm{Reference}\left("quandl","ODA/USA_PPPGDP"\right),\mathrm{Reference}\left("quandl","ODA/CAN_PPPGDP"\right),\mathrm{Reference}\left("quandl","ODA/DEU_PPPGDP"\right),\mathrm{Reference}\left("quandl","ODA/JPN_PPPGDP"\right)\right]\right)$
 ${\mathrm{ds3}}{:=}\left[\begin{array}{c}\left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{United States Country GDP based on PPP Valuation, USD Billions}}\\ {\mathrm{Quandl ODA/USA_PPPGDP}}\\ {\mathrm{up to 40 rows \left(annual\right), 1 column}}\\ {\mathrm{1980-12-31 - 2019-12-31}}\end{array}\right]\\ \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Canada Country GDP based on PPP Valuation, USD Billions}}\\ {\mathrm{Quandl ODA/CAN_PPPGDP}}\\ {\mathrm{up to 40 rows \left(annual\right), 1 column}}\\ {\mathrm{1980-12-31 - 2019-12-31}}\end{array}\right]\\ \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Germany Country GDP based on PPP Valuation, USD Billions}}\\ {\mathrm{Quandl ODA/DEU_PPPGDP}}\\ {\mathrm{up to 40 rows \left(annual\right), 1 column}}\\ {\mathrm{1980-12-31 - 2019-12-31}}\end{array}\right]\\ \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Japan Country GDP based on PPP Valuation, USD Billions}}\\ {\mathrm{Quandl ODA/JPN_PPPGDP}}\\ {\mathrm{up to 40 rows \left(annual\right), 1 column}}\\ {\mathrm{1980-12-31 - 2019-12-31}}\end{array}\right]\end{array}\right]$ (3)
 > $\mathrm{BubblePlot}\left(\mathrm{ds1},\mathrm{ds2},\mathrm{ds3},\mathrm{data_legend}=\left["Services share of GDP","Industry share of GDP","GDP \left(PPP\right)"\right],\mathrm{bubble_legend}=\left["USA","Canada","Germany","Japan"\right]\right)$

Set the time range to one year, frames to daily, half the bubble sizes, and add a title.

 > $\mathrm{BubblePlot}\left(\mathrm{ds1},\mathrm{ds2},\mathrm{ds3},\mathrm{data_legend}=\left["Services share of GDP","Industry share of GDP","GDP \left(PPP\right)"\right],\mathrm{bubble_legend}=\left["USA","Canada","Germany","Japan"\right],\mathrm{time_range}="1999-01-01".."1999-12-31",\mathrm{frames}=\mathrm{daily},\mathrm{bubble_scale}=0.5,\mathrm{title}="GDP in 1999"\right)$

Generate a single non-animated plot with time series.

 > $\mathrm{BubblePlot}\left(\mathrm{ds1},\mathrm{ds2},\mathrm{ds3},\mathrm{data_legend}=\left["Services share of GDP","Industry share of GDP","GDP \left(PPP\right)"\right],\mathrm{bubble_legend}=\left["USA","Canada","Germany","Japan"\right],\mathrm{time_range}="2005-03-15"\right)$
 >