matlab中boxplot函数的参数设置_matlab 命令 boxplot

本文详细介绍了Matlab中boxplot命令的使用方法,包括如何创建盒图和“须”图,以及如何调整各种参数以改变图表的外观。通过具体的例子展示了不同参数设置的效果,帮助读者更好地理解和应用这一功能。

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

Matlab中有关boxplot(X)命令的解释:boxplot(X) produces a box and whisker plot for each column of the matrix X. The box has linesat the lower quartile, median, and upper quartile values. Whiskers extend from each end of the box to the adjacent values in the data—by default, the most extreme values within 1.5 times the interquartile range from the ends of the box. Outliers are data with values beyond the ends of the whiskers. Outliers are displayed with a red + sign.

格式boxplot(X) %产生矩阵X的每一列的盒图和“须”图,“须”是从盒的尾部延伸出来,并表示盒外数据长度的线,如果“须”的外面没有数据,则在“须”的底部有一个点。boxplot(X,notch) %当notch=1时,产生一凹盒图,notch=0时产生一矩箱图。boxplot(X,notch,'sym') %sym表示图形符号,默认值为“+”。boxplot(X,notch,'sym',vert) %当vert=0时,生成水平盒图,vert=1时,生成竖直盒图(默认值vert=1)。boxplot(X,notch,'sym',vert,whis) %whis定义“须”图的长度,默认值为1.5,若whis=0则boxplot函数通过绘制sym符号图来显示盒外的所有数据值。

Examples 1

The following commands create a box plot of car mileage grouped by country.

load carsmall

boxplot(MPG,Origin)

Examples 2The following example produces notched box plots for two groups of sample data.

x1 = normrnd(5,1,100,1);

x2 = normrnd(6,1,100,1);

boxplot([x1,x2],'notch','on')

Examples 3

x1 = normrnd(5,1,100,1);

x2 = normrnd(6,1,100,1);

boxplot([x1,x2])

The difference between the medians of the two groups is approximately 1.Since the notches in the boxplot do not overlap, you can conclude, with 95% confidence, that the true medians do differ.

Examples 4

The following figure shows the boxplot for same data with the length of the whiskers specified as 1.0 times the interquartile range. Points beyond the whiskers are displayed using +.

x1 = normrnd(5,1,100,1); x2 = normrnd(6,1,100,1); boxplot([x1,x2],'notch','on','whisker',1)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值