how to plot boxplot of two matrix
8 次查看(过去 30 天)
显示 更早的评论
I have two matrix with different sizes:
A (13*5)
B (9*5)
I want to plot each cloumn of A next to similar coulmn of B, but with diferent color. (i.e. I should have 10 box within my boxplot plot)
Roxan
0 个评论
回答(1 个)
the cyclist
2020-8-15
There are likely a few different ways to do this task. Here is one straightforward way:
A = rand(13,5);
B = rand(9,5);
xc = 1:5;
offset = 0.1;
w = 0.1;
figure
hold on
boxplot(A,'Positions',xc-offset,'Widths',w,'Colors','r');
boxplot(B,'Positions',xc+offset,'Widths',w,'Colors','k');
4 个评论
the cyclist
2020-8-17
The solution I posted can be very easily changed to the case where the matrices are different sizes, but you didn't seem to like that solution, so I won't post that.
Especially when the data are different sizes, how do you want to decide which columns should be near each other?
You need to add more detail about what you want. You are leaving us to guess too much.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spline Postprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!