Re: Box-Whisker plots in IDL [message #55403 is a reply to message #55402] |
Mon, 20 August 2007 12:18   |
teich
Messages: 33 Registered: May 2007
|
Member |
|
|
On Aug 20, 3:01 pm, Brian Larsen <balar...@gmail.com> wrote:
> When you solve this problem if you wouldn't mind posting the function/
> procedure you come up with I would love to have a copy as I sometimes
> do those and haven't had the time/patience to implement them in idl
> yet.
>
> Cheers,
>
> Brian
>
> ------------------------------------------------------------ --------------- ------
> Brian Larsen
> Boston University
> Center for Space Physics
Well, I am looking into the histogram procedure, but I am not getting
what I think the 25th and 75th quartiles should be. It seems
histogram is not so easy to master. What I am looking into is doing
the following:
data=randomu(sd,100)*100
box plot needs min, max, median which are straight forward:
min(data)
max(data)
median(data,/even)
For the quartiles I am trying:
lower_ind=where(data lt median(data,/even))
upper_ind=where(data gt median(data,/even))
qtr_25th=median(data[lower_ind(0):lower_ind(n_elements(lower _ind)-1)],/
even)
qtr_75th=median(data[upper_ind(0):upper_ind(n_elements(upper _ind)-1)],/
even)
However, I think this would work only for a monotonically increasing
array. I am not sure how to get 'data' like that. If anyone wants to
add to this, feel free.
How
|
|
|