Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Graphics > Gnuplot interactive function plotter > Re: binning a d...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 3520 of 3637
Post > Topic >>

Re: binning a distribution of real numbers...

by tv <tommaso.vinci@[EMAIL PROTECTED] > Sep 30, 2008 at 12:19 AM

On Sep 24, 6:32 pm, mcastel <m.castell...@[EMAIL PROTECTED]
> wrote:
> Hello,
>
> I have a casual distribution of real number between two values (say
> zero and one) and I would like to create an histogram, in which I can
> have (say) ten bins, first one counting the number of points between 0
> and 0.1, the second counting points between 0.1 and 0.2, and so on.


it's quite easy with gnuplot but don't pretend much more...

you define two functions like this:

binit(binmin,bin,x) = binmin+bin*(0.5+int((x-binmin)/bin))
isinside(binmin,x,binmax)=x<binmin|x>binmax? 0:1

the you plot like this

plot 'data' using (binit(0.0,0.1,$1)):(isinside(0.0,$1,1.0)) smooth
frequency with step


it's a bit tricky to understand... I admit the key is to use the
"smooth frequency" key
from "help frequency"
The `frequency` option makes the data monotonic in x; points with the
same
 x-value are replaced by a single point having the summed y-values.
The
 resulting points are then connected by straight line segments.

Tommaso
 




 2 Posts in Topic:
binning a distribution of real numbers...
mcastel <m.castellani@  2008-09-24 09:32:28 
Re: binning a distribution of real numbers...
tv <tommaso.vinci@[EMA  2008-09-30 00:19:09 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 6:02:10 CST 2008.