%% Plot Data from a Table
% A convenient way to plot data from a table is to pass the table to the bubblechart function and specify the variables you want to plot. For example, read patients.xls as a table tbl. Plot the Systolic, Diastolic, and Weight variables by passing tbl as the first argument to the bubblechart function followed by the variable names. By default, the axis labels match the variable names.

tbl = readtable('patients.xls');
bubblechart(tbl,'Systolic','Diastolic','Weight');

%
% You can also plot multiple variables at the same time. For example, plot both blood pressure variables versus the Height variable by specifying the yvar argument as the cell array {'Systolic','Diastolic'}. Change the range of bubble sizes to be between 5 and 20 points. Then add a legend. The legend labels match the variable names.

bubblechart(tbl,'Height',{'Systolic','Diastolic'},'Weight');
bubblesize([5 20])
legend

% Copyright 2020 The MathWorks, Inc.