I want to extract values from built in boxplot function. In A1 there are three extra large values (1000000) while correct maximum value is 273.
a = boxplot(A1)
a =
173.0043
174.0028
175.0033
176.0027
177.0032
178.0027
179.0031
I tried this but I don't what the heck are these values, these are not the outliers themself nor the index of outliers.
findobj(gcf,'tag','Outliers');
returns only 179.0031
How to extract outliers or their indexes from boxplot?
BOXPLOT returns the array of handles for different graphic objects.
At default parameters (plotstyle
set to outline
, etc) the output is 7 x M array of handles, where M is number of boxplot groups, each having the following 7 handles:
At different parameters boxplot may return different number of handles, so it's better to find what you need by tag.
To extract the data you have to access the Data property of particular object, if this property exists.
h = findobj(gcf,'tag','Outliers');
xdata = get(h,'XData');
ydata = get(h,'YData');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With