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

Home » Public Forums » archive » Re: histogram, how to trasfer from linear bins to logarithmic bin?
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: histogram, how to trasfer from linear bins to logarithmic bin? [message #68181 is a reply to message #68180] Tue, 29 September 2009 07:31 Go to previous messageGo to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
Along the lines that David is saying here, when all the value_locate
stuff was hot on the group I wrote up a few routines that *might* be
useful to you.

One of them "log_bins" is like findgen for log spaced bins over a
given range. I use this constantly for binning particle energy
spectra.
http://people.bu.edu/balarsen/IDLdoc/log_bins.html

Another is "histo_bins" this creates a histogram with use specified
bins, it is exactly what David did in his logbins page just bundled up
for easier (for me) use.
http://people.bu.edu/balarsen/IDLdoc/histo_bins.html


To recreate David's example:
IDL> v1 = Randomu(-3L, 1000) * 100
IDL> v2 = Randomu(-5L, 1000) * 100
IDL> ratio = v1 / v2
IDL> bins=log_bins(0.01, 1000, 6)
IDL> print, log_bins(0.01, 1000, 6)
0.0100000 0.100000 1.00000 10.0000 100.000
1000.00
IDL> hist=histo_bins(ratio, bins)
IDL> plot, bins, hist, /xlog, psym=10

For me this is easier than the labels and xyouts stuff.




Cheers,

Brian

------------------------------------------------------------ --------------
Brian Larsen
Boston University
Center for Space Physics
[Message index]
 
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: Probably a really simple read_ascii quesion....
Next Topic: Polynomial Fitting question

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

Current Time: Thu Oct 09 21:11:19 PDT 2025

Total time taken to generate the page: 1.68455 seconds