2013-11-26 32 views
0

我想創建一個準附加報告的第15/16頁上顯示的準棚線圖。Matlab Boxplots

comisef.eu/files/wps031.pdf

理想我只想顯示位數,最大值和最小值的報告。

我也想和報告中顯示的間距相似。

目前我有兩個矩陣存儲在其中的所有必要的值,但不知道如何做到這一點在MATLAB。

箱線圖功能給這使得結果圖看糊塗尤其是當我試圖在一個頁面上繪製200在原來的報告太多數據(離羣等)。

有另一種功能,可以讓同樣的事情在MATLAB的報告?這裏

巴茲

行是一些測試數據的每一行代表10只將一個數據集的估計的,每一列代表對於給定的觀察試驗編號。

由於輸入矩陣的列箱線的工作,你需要轉置矩陣。

是否有可能關閉離羣值和四分位間距?理想情況下,我只想看看最大值,最小值和中值?

可以重複數據低於起牀到200或者如果有必要,我可以發送更多的數據。

0.00160329732202511 0.000859407819412016 0.000859407819411159  0.0659939338995606 0.000859407819416322 0.000859407819416519 2.56395024851142e-15 2.05410662537078e-14 0.000859407819416209 
1.67023155116586e-06 8.88178419700125e-16 1.67023155115637e-06 0.000730536218639616 1.67023155105582e-06 3.28746017489609e-15 4.41416632660789e-15 1.67023155094400e-06 1.67023155097567e-06 
1.42410590843629e-06 1.42410590840224e-06 1.76149166727218e-15 5.97790925044131e-15 1.42410590843863e-06 2.87802701599909e-15 9.31529385335274e-16 9.17306727455842e-16 0.000820358763518906 
8.26849110292527e-16 3.23505095414772e-15 4.38139485761850e-07 4.38139485938112e-07 4.38139485981887e-07 0.000884647755317917 3.72611754134110e-15 4.38139485974329e-07 4.38139485923219e-07 
0.000160661751819407 0.000870787937135265 0.000870787937136209 1.16934122581182e-15 9.02860049358913e-16 1.18053134896556e-15 1.40433338743068e-15 0.000870787937135929 1.13510916297112e-15 
1.16934122581182e-15 3.80292342262841e-05 3.80292342263200e-05 0.00284904319356532 1.74649997619656e-15 3.80292342264024e-05 0.00284904319356537 1.01267920724547e-15 0.00284904319356540 
    0.100091800399985 0.100091773169254 0.100091803903140 0.000770464183529358 0.100091812455930 3.49996706323281e-05 3.49996706323553e-05 1.05090687851466e-15 0.100091846333800 
0.00100555294602561 0.00100555294601056 0.105365907420183 0.000121078082591672 9.02860049358913e-16 0.000121078082591805 4.49679158258033e-15 7.77684615168284e-16 0.000121078082591693 
0.122539456858702 0.000363547764643498 0.000363547764643509 0.122516928568610 0.0101487499394213 0.122408366511784 0.000363547764643519 1.13510916297112e-15 0.122521393586646 
0.000460749357561036 0.000460749357560646 3.27600489447913e-13 1.18053134896556e-15 0.000460749357561239 1.54689304063675e-15 0.000460749357560827 0.000460749357561205 1.16934122581182e-15 
+0

其實我開始思考該boxplot是不適合這個問題。我認爲這更接近我想要的:http://www.mathworks.com/matlabcentral/fileexchange/35294-matlab-plot-gallery-errorbar-plot/content/html/Errorbar_Plot.html – Bazman

+0

類似於我可以的例子計算中位數,男士和最小值,並繪製中值,其中最大值和最小值表示誤差線(似乎非對稱誤差線是可能的)。你知道如何控制錯誤欄的間距嗎? – Bazman

+0

啊不,似乎是行不通的有,你必須對另一個變量 – Bazman

回答

2

除了使用箱線圖,我建議剛繪製一條從分線到最大,並在中間做出標記。 Boxplot從25到75百分位數畫框,聽起來不像你想要的。事情是這樣的:

% fake data 
nPoints = 100; 
data = 10*rand(10, nPoints); 

% find statistics 
minData = min(data, [], 1); 
maxData = max(data, [], 1); 
medData = median(data); 

% x coordinates of each line. Change this to change the spacing. 
x = 1:nPoints; 

figure 
hold on 

%plot lines 
line([x; x], [minData; maxData]) 
% plot cross at median 
plot(x, medData, '+') 

line plot for min, max and median

編輯:有水平線和第二軸,你可以做這樣的事情:

figure 
h1 = subplot(1,2,1); 
h2 = subplot(1,2,2); 

% left subplot 
axes(h1) 
hold on 
%plot lines 
line([minData; maxData], [x; x]) 

% plot cross at median 
plot(medData, x, '+') 

% link the axes so they will have the same limits 
linkaxes([h1,h2],'y') 
% turn off ticks on y axis. 
set(h2, 'YTick', []) 

horizontal min, max, median line plot

+0

啊繪製數據不對稱errorbars是的,這就是更喜歡它,對不起,這表明箱線圖這是錯誤的。我想轉該圖90度有效地轉置值,然後與另一種圖形繪製它並排,使得(理想地)它們共享相同的Y軸(在上面的例子中是1-100,它已經旋轉之後但每個人都有自己的x軸,請看到我原來的問題的PDF文件。能不能做到? – Bazman

2

我認爲這是一個玩設置的問題。您可以嘗試:

boxplot(X, 'plotstyle', 'compact', 'colors', 'k', 'medianstyle', 'line', 'outliersize', 0); 

Explanation: 
'plotstyle', 'compact': makes the boxes filled and the lines undashed 
'colors', 'k': color is black 
'medianstyle', 'line': the median is marked by a line 
'outliersize', 0: if outlier size is zero, you don't see them 

Other you can try: 
'orientation', 'vertical': this flips the orientation, depends on your data 
'whisker', 10 (or higher): this sets the maximum whisker length as a function of the interquartile limits (if you crank it up, it will eventually default to max and min values), I wasn't sure if this is what you wanted. Right now, it goes to the 25th and 75th percentile values. 

間距將取決於您擁有多少數據。如果您使用某些數據進行編輯,我可以爲您嘗試。