Re: Probability contour plots [message #53602 is a reply to message #53434] |
Fri, 20 April 2007 14:18  |
ben.bighair
Messages: 221 Registered: April 2007
|
Senior Member |
|
|
On Apr 13, 1:58 am, "Klemens" <jokulhl...@web.de> wrote:
> Hello together,
>
> is there anybody who has written an IDL routine to produce probability
> contour plots from twodimensional datasets, where an isoline of 10 %
> means that 10 % of all value pairs are enclosed by this line ? Also it
> should be possible to find two or more separated lines with the same
> value when clustering of the data makes it necessary....
> It would be great if anybody has a routine like this or could give me
> some advice how to produce plots like these..
>
> Thanks for your help in advance !
>
> Klemens
Hi,
Will this work for you?
;make two "images"
n = 100
x = RANDOMU(s,n,n)*100
y = RANDOMU(s,n,n)*100
;reformat them into a 2xn array suitable for HIST_ND
xy = TRANSPOSE([[REFORM(X,n*n)],[REFORM(Y,n*n)]])
;bin them using JD Smith's HIST_ND
h = HIST_ND(xy,[10,10])
;convert to a probability
p= h/TOTAL(h)
; this might not have any bins with 10% or more of the pixels - but
some must have
;at least 1%
CONTOUR, p, LEVEL = [0.01]
Ben
|
|
|