matlab输出箱线图的五个特征值,绘制分组箱线图Matlab的最有效方法

本文介绍了如何在Matlab中根据数据分组创建箱线图,并解决标签对齐和导出图至其他格式的问题。通过调整代码,实现了数据分组、自定义标签以及对内标签居中显示,同时探讨了导出为PNG格式可能遇到的挑战。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I have 3 vectors: Y=rand(1000,1), X=Y-rand(1000,1) and ACTid=randi(6,1000,1).

I'd like to create boxplots by groups of Y and X corresponding to their group value 1:6 (from ACTid).

This is rather ad-hoc and looks nasty

for ii=

dummyY(ii)={Y(ACTid==ii)};

dummyX(ii)={X(ACTid==ii)}

end

Now I have the data in a cell but can't work out how to group it in a boxplot. Any thoughts?

I've found aboxplot function that looks like this but I don't want that, I'd like the builtin boxplot function because i'm converting it to matlab2tikz and this one doesn't do it well.

AnEV9.png

EDIT

Thanks to Oleg: we now have a grouped boxplot... but the labels are all skew-whiff.

xylabel = repmat({'Bleh','Blah'},1000,1); % need a legend instead, but doesn't appear possible

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值