IoSR-Surrey / MatlabToolbox

General purpose Matlab toolbox
MIT License
126 stars 43 forks source link

Boxplot backwards incompatibility #2

Closed TGabor closed 8 years ago

TGabor commented 8 years ago

Hi,

first, thanks for your great toolbox. I just tried the new version of boxPlot (commit 4588ab25a4f391a0fa9f98e2c0d77dbb7da4f180) and noticed that it produces different resuts for the same input data compared to the old box_plot.m I have from FEX: % Last changed: $Date: 2015-12-07 10:55:15 +0000 (Mon, 07 Dec 2015) $ % Last committed: $Revision: 451 $)

For example, the quantiles have a different extent, although there are no outliers. I generated a gif that illustrates the problem (see e.g. the 16384 case in the gif) output

Is there a change in the outlier computation as well? The old box_plot produces a different set of outliers than the new one (see e.g. the blue box for the 512 case in the gif) output2

I use Matlab2015b under Win7.

I uploaded a minimum working example (test_boxplot.m) along with the data here: debug_boxPlot.zip

chummersone commented 8 years ago

Hi. Thanks so much for reporting the bug, and producing the MWE. The different results are as a result of the default 'method' parameter, which was erroneously specified as 'R-5' in the newer version (despite saying 'R-8' in the help), and specified as 'R-8' in the older version. I've corrected the error, and uploaded a fix to the repo. Note that the x-displacement of the outliers may still differ because the offset is pseudo-random, but also because I tweaked the displacement algorithm.

TGabor commented 8 years ago

Nice, thanks for your quick fix! :-)