multiple boxplots in one figure
Show older comments
hi. i want to make box plots of three matrices (a, b and c) vs , each of order 1x31. but i want all boxplots in the same figure. anyone? thanks.
Answers (1)
Star Strider
on 17 May 2018
Try this:
a = randn(1,31);
b = randn(1,31)*2 + 2;
c = randn(1,31)/2 + 3;
figure(1)
boxplot([a(:) b(:) c(:)])
set(gca, 'XTickLabel', {'a','b','c'}) % Optional
It forces them to become column vectors, horizontally concatenates them, and plots them.
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!