为什么顶部/底部箱形胡须弯曲?

时间:2015-05-19 18:10:03

标签: matlab plot boxplot

创建(非高斯)变量W_BP的方框图,并将晶须长度更改为包含第1百分位数到第99百分位数。问题是,每个晶须的顶部和底部都是弯曲的。关于如何修复的建议?代码和图片如下:

Sample_Box_Plot

clc;
clear all;

% load datafile
load TRMM_Tropics_regression_data_pt_1mmhr_2004.mat;

whos

p = prctile(W_BP,[1,99]);
figure;
boxplot(W_BP,'whisker',2.5,'outliersize',2);
hold on;

% replace upper end y value of whisker
h = flipud(findobj(gca,'Tag','Upper Whisker'));
for j = 1:length(h);
    ydata = get(h(j),'YData');
    ydata(2) = p(2,j);
    set(h(j),'YData',ydata);
end

% replace all y values of adjacent value
h = flipud(findobj(gca,'Tag','Upper Adjacent Value'));
for j = 1:length(h);
    ydata = get(h(j),'YData');
    ydata(2) = p(2,j);
    set(h(j),'YData',ydata);
end

% replace lower end y value of whisker
h = flipud(findobj(gca,'Tag','Lower Whisker'));
for j = 1:length(h);
    ydata = get(h(j),'YData');
    ydata(1) = p(1,j);
    set(h(j),'YData',ydata);
end

% replace all y values of adjacent value
h = flipud(findobj(gca,'Tag','Lower Adjacent Value'));
for j = 1:length(h);
    ydata = get(h(j),'YData');
    ydata(1) = p(1,j);
    set(h(j),'YData',ydata);
end
t = title('TRMM-3B42 Cluster Area vs Cluster Power, Tropics (RR GTE 0.1mmhr), May-Sep 2004');
set(t, 'FontWeight', 'bold', 'FontSize', 10)
set(gca, 'FontWeight', 'bold', 'FontSize', 14)
set(gca, 'YLim',[10^0 10^6])
set(gca, 'YScale', 'log');
xlabel('Bin Number');
ylabel('Cluster Power (GW)');
print -dpng Sample_Boxplot.png

0 个答案:

没有答案