%% Specify Bubble Transparency and Outline Color
% Define a set of bubble coordinates as the vectors x, y, and z. Define sz as a vector that specifies the bubble sizes. Then create a bubble chart of x, y, and z. By default, the bubbles are 60% opaque, and the edges are completely opaque with the same color.

x = rand(1,20);
y = rand(1,20);
z = rand(1,20);
sz = rand(1,20);
bubblechart3(x,y,z,sz);

%
% You can customize the opacity and the outline color by setting the MarkerFaceAlpha and MarkerEdgeColor properties, respectively. One way to set a property is by specifying a name-value pair argument when you create the chart. For example, you can specify 20% opacity by setting the MarkerFaceAlpha value to 0.20.

bc = bubblechart3(x,y,z,sz,'MarkerFaceAlpha',0.20);

%
% If you create the chart by calling the bubblechart3 function with a return argument, you can use the return argument to set properties on the chart after creating it. For example, you can change the outline color to purple.

bc.MarkerEdgeColor = [0.5 0 0.5];

% Copyright 2020 The MathWorks, Inc.