From: Robert on
What code could I use to retrieve the actual value used to draw a whisker of a boxplot? That is, how do I search the data values in a vector to obtain the adjacent value that is less than Q4 +(1.5(Q4-Q2)) and Q2-(1.5((Q4-Q2))?

Regards,

Robert.
From: Tom Lane on
> What code could I use to retrieve the actual value used to draw a whisker
> of a boxplot? That is, how do I search the data values in a vector to
> obtain the adjacent value that is less than Q4 +(1.5(Q4-Q2)) and
> Q2-(1.5((Q4-Q2))?

Robert, you could do something like this:

q = quantile(x,[.25 .5 .75]);
find(x > q(3) + (1.5*(q(3)-q(1))))
find(x < q(1) - (1.5*(q(3)-q(1))))

I assume that's what you mean. If you want to get at the handles to the
things on the plot, you can do something like this:

boxplot(randn(100,1))
h=findall(gca,'tag','Outliers');
set(h,'marker','x')

-- Tom