Function to create a figure showing the individual data points, mean, standard deviation, and distribution of multiple categories.
Plot the distribution to the right of the figure outline (default) or next to the error bars. Choose between a kernel (default) or gaussian distribution. If the distribution is plotted to the right of the figure outline, the figure contains two subplots: Fig.jit and Fig.dist. If the distribution is plotted next to the error bars, the figure contains one subplot: Fig.jit.
Options such as personalized colors, marker size, linewidth, etc. are included.
data = [randn(1,50) randn(1,50)+1.6 randn(1,50)+1.4];
cats = [cellstr(repmat('Group A',50,1)); cellstr(repmat('Group B',50,1)); cellstr(repmat('Group C',50,1))];
Fig = jitter_distribution_figure(data, cats, 'YLabel', 'Y label');