Statistics - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

Statistics

  

BubblePlot

  

generate bubble plots

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

BubblePlot(X, Y, Z, options, plotoptions)

BubblePlot['interactive'](X, Y, Z)

Parameters

X

-

first data sample

Y

-

second data sample

Z

-

third data sample

options

-

(optional) equation(s) of the form option=value where option is one of data_legend, bubble_legend, time_range, format, frames, or bubble_scale; specify options for generating the bubble plot

plotoptions

-

options to be passed to the plots[display] command

Options

  

The options argument can contain one or more of the options shown below. All unrecognized options will be passed to the plots[display] command. See plot/options for details.

• 

The following options can only be used if X, Y, and Z contain time series data.

• 

data_legend = list(string)

  

If used, this option must be a list of strings containing three elements exactly, specifying what the data contained in X, Y, and Z represent.

• 

bubble_legend = list(string)

  

If used, this option must have the same number of elements as the number of elements in X, Y, or Z. Give a name to each bubble which is displayed in a legend.

• 

time_range = {string, integer, range(string), range(integer), identical(auto)}

  

If a string or string range is passed, an attempt is made to deduce the format, unless the format option is passed. An integer or integer range is interpreted as timestamps. Using a single string or integer produces a static plot except when the frames option is set to an integer. Use non-singleton range to generate an animated plot. The default is auto, which sets the start time to the earliest time such that at least one bubble can be displayed, and the end time to the latest time such that all the bubbles can be displayed.

• 

format = string

  

Time format string to be used when parsing time_range. See StringTools:-ParseTime.

• 

frames = {identical(auto, daily, weekly, monthly, quarterly, annual), posint}

  

The time points at which the frames are generated. The default, auto, will try to deduce the frequency of the time series containing most data points in the time range to be plotted. It generates frames that are uniform distance apart and fit closely to the times of the data contained in that time series, covering the time range determined by time_range as much as possible (except when this procedure would result in more than 400 frames being plotted). If the frequency cannot be deduced or would result in more than 400 frames being plotted, then the 400 frames are plotted at uniform distance apart, covering the entire time range as determined by time_range. If one of daily, weekly, monthly, quarterly, or annual is passed, then the first frame is at the start time as determined by time_range. For any frame, if advancing in time by an amount according to frames, such as one month, would not be past end time, then one more frame is plotted. Otherwise, the current frame is the last frame. If an integer is passed, then exactly that number of frames is plotted. Frames generated at time points that are not contained in the time series are interpolated.

• 

bubble_scale = numeric

  

The bubble sizes will change if the plot region in the worksheet is resized and this option changes the sizes of the bubbles relative to the size of the plot region. The sizes of the bubbles are normalized so that given the same plot region size and bubble_scale value, the maximum of the bubble sizes over the entire time range is same even with different data. bubble_scale changes the sizes relative to the plot region size. Between bubbles, their relative values are represented by their relative sizes. For instance, a bubble with half the area of another bubble represents a value that is half of the other. The default is 1, which does not change the sizes. A value of 0.5 halves the area, and a value of 2 doubles the area. A value between 0.2 and 3 will usually produce good results.

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 is generated by default, where the corresponding time series defines 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

withStatistics:

X1,2,3,4,5,6,7,8,9,9:

Y1,4,2,3,3,1,5,1,5,5:

Z5,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.

BubblePlotX,Y,Z

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

withDataSets:

ds1VectorReferencequandl,WORLDBANK/USA_NV_SRV_TETC_ZS,Referencequandl,WORLDBANK/CAN_NV_SRV_TETC_ZS,Referencequandl,WORLDBANK/DEU_NV_SRV_TETC_ZS,Referencequandl,WORLDBANK/JPN_NV_SRV_TETC_ZS

module...end modulemodule...end modulemodule...end modulemodule...end module

(1)

ds2VectorReferencequandl,WORLDBANK/USA_NV_IND_TOTL_ZS,Referencequandl,WORLDBANK/CAN_NV_IND_TOTL_ZS,Referencequandl,WORLDBANK/DEU_NV_IND_TOTL_ZS,Referencequandl,WORLDBANK/JPN_NV_IND_TOTL_ZS

module...end modulemodule...end modulemodule...end modulemodule...end module

(2)

ds3VectorReferencequandl,ODA/USA_PPPGDP,Referencequandl,ODA/CAN_PPPGDP,Referencequandl,ODA/DEU_PPPGDP,Referencequandl,ODA/JPN_PPPGDP

module...end modulemodule...end modulemodule...end modulemodule...end module

(3)

BubblePlotds1,ds2,ds3,data_legend=Services share of GDP,Industry share of GDP,GDP (PPP),bubble_legend=USA,Canada,Germany,Japan

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

BubblePlotds1,ds2,ds3,data_legend=Services share of GDP,Industry share of GDP,GDP (PPP),bubble_legend=USA,Canada,Germany,Japan,time_range=1999-01-01..1999-12-31,frames=daily,bubble_scale=0.5,title=GDP in 1999

Generate a single non-animated plot with time series.

BubblePlotds1,ds2,ds3,data_legend=Services share of GDP,Industry share of GDP,GDP (PPP),bubble_legend=USA,Canada,Germany,Japan,time_range=2005-03-15

Compatibility

• 

The Statistics[BubblePlot] command was updated in Maple 2015.

• 

The data_legend, bubble_legend, time_range, format, frames and bubble_scale options were introduced in Maple 2015.

• 

For more information on Maple 2015 changes, see Updates in Maple 2015.

See Also

Statistics

Statistics/Visualization

Statistics[PointPlot]

Statistics[QuantilePlot]

Visualizing Multiple Data Sets with BubblePlot