MATLAB Answers

How can I add a legend to my boxplot for specific elements?

8 views (last 30 days)
Nathalie
Nathalie on 11 Jan 2020
This is the code for my figure:
AD is a matrix with data (8x10).
figure(1);
hold on;
A = boxplot(AD,'OutlierSize',4); % Boxplot
plot(t,AD,'Marker','.','LineStyle','none','MarkerSize',12); % Data single participants
MA = plot(mean(AD,'omitnan'),'Marker','x','Color','k','LineStyle','none'); % Mean for each training
title('Amplitudeverschil');
ylabel('Amplitude(%)');
xlabel('trainingsnummer');
axis([0.5 11 0 80]);
grid on;
hold off;
This is the result:
AmplBoxplot.jpg
How can I add a legend in wich I include: Median, Min & Max, Outlier, interquartile ranges and the mean (plotted as MA).

  0 Comments

Sign in to comment.

Answers (0)

Sign in to answer this question.