bubblechart3

Draws a 3-D scatter plot whose markers vary in size and color.

Category: Graphics > 2-D and 3-D Plots

Syntax

bubblechart3(x, y, z, sz)

Draws a bubble at each (x, y, z) with area scaled by sz.

bubblechart3(x, y, z, sz, c)

Also colors the bubbles by c.

b = bubblechart3(___)

Also returns the BubbleChart object.

Description

bubblechart3 is the three-dimensional version of bubblechart, so a bubble carries up to five variables: three positions, a size and a color. bubblesize, bubblelim and bubblelegend control the size mapping in the same way.

Input arguments

x, y, z
Vectors of coordinates.
sz
Vector giving the size of each bubble.
c
Colors: one value per bubble or a color specification.

Output arguments

b
The BubbleChart object.

Example

Bubbles in space

x = [1 2 3 4];
y = [2 4 1 3];
z = [1 3 2 4];
bubblechart3(x, y, z, [10 30 20 50], [1 2 3 4]);
xlabel('x')
ylabel('y')
zlabel('z')

In the app, the figure is drawn below the code.

See also

bubblechart bubblesize bubblelim scatter3