How can I represent the vectors below as in the figure below?
6 次查看(过去 30 天)
显示 更早的评论
I have below these three vectors:
CoverageArea_mean = [84.4735,0,21.1779,4.5211,6.4247,2.3795,2.1416,0]; %FEC = 3.8x10^-3
CoverageArea_min = [98.5128,92.5640,21.1779,21.1779,6.9007,6.9007,2.1416,2.1416]; %FEC = 3.8x10^-3
CoverageArea_max = [70.1963,0,19.0363,0.4759,5.9488,0.2380,2.1416,0]; %FEC = 3.8x10^-3
I would like to draw them as in the figure below:
I am not sure If they will be fit for box plot or not. I want to take a value every time from the three vectors and represent them as a bove.
Any idea or assistance please?
0 个评论
回答(1 个)
Daniele Sportillo
2022-11-28
If you have raw data you can use Box chart (box plot). Otherwise the following piece of code should work.
CoverageArea_mean = [84.4735,0,21.1779,4.5211,6.4247,2.3795,2.1416,0]; %FEC = 3.8x10^-3
CoverageArea_min = [98.5128,92.5640,21.1779,21.1779,6.9007,6.9007,2.1416,2.1416]; %FEC = 3.8x10^-3
CoverageArea_max = [70.1963,0,19.0363,0.4759,5.9488,0.2380,2.1416,0]; %FEC = 3.8x10^-3
lineLimit = 0.4;
figure
hold on
for i = 1:numel(CoverageArea_mean)
line([i-lineLimit i+lineLimit],[CoverageArea_min(i), CoverageArea_min(i)],'Color','k','LineWidth',2);
line([i i],[CoverageArea_min(i), CoverageArea_max(i)],'Color','k');
line([i-lineLimit i+lineLimit],[CoverageArea_max(i), CoverageArea_max(i)],'Color','k','LineWidth',2);
end
hold off
xlim([0 numel(CoverageArea_mean)+1])
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!