%% Plot Table Data with Custom Marker Sizes and Colors
% One way to plot data from a table and customize the colors and marker sizes is to set the ColorVariable and SizeData properties. You can set these properties as name-value arguments when you call the swarmchart3 function, or you can set them on the Scatter object later.
% For example, create a table with four variables of random numbers, and plot the X, Y, and Z variables with filled markers. Vary the marker colors by specifying the ColorVariable name-value argument. Return the Scatter object as s, so you can set other properties later.

tbl = table(randi(2,100,1),randn(100,1),randn(100,1),randn(100,1), ...
   'VariableNames',{'X','Y','Z','Colors'});

s = swarmchart3(tbl,'X','Y','Z','filled','ColorVariable','Colors');

%
% Change the marker sizes to 100 points by setting the SizeData property.

s.SizeData = 100;

% Copyright 2020 The MathWorks, Inc.