%% Preserve Bubble Limits Between Plotting Commands
% When you create multiple bubble charts within the same axes, the bubble limits change for every bubble chart you add to the axes. They change to accommodate the sz values for all the charts. To hold the limits constant between plotting commands, use the bubblelim('manual') command.
% For example, create a bubble chart with sz values that range from 1 to 20.

x =  1:10;
y1 =  [4 7 10 7 3 6 5 1 9 7];
sz1 = [5 1 14 6 9 12 15 20 8 2];
bubblechart(x,y1,sz1)
hold on

%
% Query the bubble limits.

bubblelim

%
% Hold the bubble limits at their current value by calling the bubblelim('manual') command. Create another bubble chart in which the sz values range from 1 to 50.

bubblelim('manual')
y2 =  [10 7 2 3 8 9 2 1 3 4];
sz2 = [5 1 14 6 9 12 15 50 8 2];
bubblechart(x,y2,sz2);

%
% Query the bubble limits again to verify that they have not changed.

bubblelim

% Copyright 2020 The MathWorks, Inc.