%% Plot Data from a Table
% A convenient way to plot data from a table is to pass the table to the bubblechart3 function and specify the variables you want to plot. For example, create a table with five variables of random numbers. Plot the X1, Y, Z and Sz variables by passing the table as the first argument to the bubblechart3 function followed by the variable names. By default, the axis labels match the variable names.

tbl = table(randn(15,1)-10,randn(15,1)+10,rand(15,1), ...
  rand(15,1),rand(15,1), ...
  'VariableNames',{'X1','X2','Y','Z','Sz'});

bubblechart3(tbl,'X1','Y','Z','Sz')

%
% You can also plot multiple variables at the same time. For example, plot X1 and X2 on the x-axis by specifying the xvar argument as the cell array {'X1','X2'}. Then add a legend. The legend labels match the variable names.

bubblechart3(tbl,{'X1','X2'},'Y','Z','Sz')
legend

% Copyright 2020 The MathWorks, Inc.