matlab中boxplot函数的参数设置_matlab命令boxplot
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.
normrnd函数用法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)
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论