comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Box-Whisker plots in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Box-Whisker plots in IDL [message #55395 is a reply to message #55393] Mon, 20 August 2007 13:56 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
teich@atmsci.msrc.sunysb.edu writes:

> Hi, Suppose data is something simple like:
>
> data=[2,3,5,7,7,10,11,11,12,15,16,17,17]
>
> I get a 75th quartile of 11.0. Shouldn't I get around 15?

JD will have to explain the difference between BINSIZE
and NBINS to us again. (And I think he is in China for
a couple of weeks.) But I got strange results with my
HISTOGRAM method, too. Here is a slightly revised program:

data=[2,3,5,7,7,10,11,11,12,15,16,17,17]
;box plot needs min, max, median which are straight forward:

minVal = min(data)
maxVal = max(data)
medianVal = median(data,/even)

; Find the quartiles.
h = Histogram(data, NBINS=4, REVERSE_INDICES=ri, $
MIN=minVal, MAX=maxVal)
qtr_25th = Median(data[ri[ri[0]:ri[2]-1]])
qtr_75th = Median(data[ri[ri[2]:ri[4]-1]])


Print, minVal, maxVal, medianVal, qtr_25th, qtr_75th
END

And the result I get with the new data:

2 17 11.0000 7.00000 16.0000



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: MODIS spectral radiance
Next Topic: How to read ASTER in ENVI?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 09:47:18 PDT 2025

Total time taken to generate the page: 0.79954 seconds