user1558576
user1558576

Reputation: 149

IDL cumulative histogram

I have an array of data, and I want to make a cumulative histogram with it in IDL. Is there an input that I can use on a HISTOGRAM, PLOTHIST, PHIST, or HISTO command that will do this for me? If there is, how do I use it?

Thank you!

Upvotes: 1

Views: 3179

Answers (1)

mgalloy
mgalloy

Reputation: 2386

Try the CUMULATIVE keyword to TOTAL:

IDL> x = randomu(seed, 1000) * 100.
IDL> h = histogram(x, binsize=10)  
IDL> ch = total(h, /cumulative, /preserve_type)        
IDL> plot, ch, psym=10

Upvotes: 2

Related Questions