在matlab中有多个方框图
我在matlab中有两个箱线图,如下所示:在matlab中有多个方框图,matlab,boxplot,Matlab,Boxplot,我在matlab中有两个箱线图,如下所示: boxplot(input1(:,2), input1(:,1)) % time accompilishing a task among genders (male/female) boxplot(input2(:,2), input2(:,1)) % time accompilishing a task among degree (bachelor/master) 我想要的是在同一个绘图中完成两个图表。因此,对于x轴上的四种情况,时间在y轴上。我如
boxplot(input1(:,2), input1(:,1)) % time accompilishing a task among genders (male/female)
boxplot(input2(:,2), input2(:,1)) % time accompilishing a task among degree (bachelor/master)
我想要的是在同一个绘图中完成两个图表。因此,对于x轴上的四种情况,时间在y轴上。我如何才能做到这一点?您可以通过简单地垂直连接表来解决这一问题:
input = [input1;input2];
boxplot(input(:,2), input(:,1))
这是假设input1中的组与input2中的组具有不同的键。例如,如果男=1,女=2,学士=1,硕士=2,它将混合课程而不会抛出错误。在这种情况下,您必须事先指定唯一键。有关更高级的选项,您可能需要查看