Adding means to separate boxplots in the same figure window?
Show older comments
Hello,
I have combined two boxplots into the same figure window but when i go to add the means i seem to be doing something wrong as both means appear on only one of the boxplots:

I was wondering how i can correctly place the means onto the correct boxplots?
The matlab code code i used is:
figure(1)
boxchart([x2,x]);
grid on;
grid minor;
hold on;
plot(mean(x2),'xr');
plot(mean(x),'xr');
hold off;
legend(["","Mean Value"]);
hold off;
Accepted Answer
More Answers (0)
Categories
Find more on Line Plots 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!