|
From: Thomas S. <t.s...@fz...> - 2009-07-22 14:36:30
|
first we need a function for binning the x-data, i.e. the continuous x-range is split into intervals of size 's': bin(x, s) = s*int(x/s) then we plot: plot "datafile" using (bin($2,0.01)):(10/300.) \ smooth frequency \ title 'smooth frequency' with boxes explanation: - the bin-function assigns the x-values within one interval (which has a width of 0.01 here) to only one x-value (the lower interval border) - with 'smooth frequency' all the y-values of data pairs with the same x-value are added - "10/300." is just a factor, you could use "1." then each data counts as '1' jamborta wrote: > > thanks a lot. could you explain the parameters of this method > > plot [0:] "datafile" u 2:(0.25*rand(0)-.35) t '', "" u > (bin($2,0.01)):(10/300.) s f t 'smooth frequency' w boxes, "" u 2:(1/300.) > s cumul t 'smooth cumulative' > > especially 10/300. and 1/300. > > I couldn't figure out why it normalises in the demo, but not for my data. > > thanks a lot > > > Thomas Sefzick wrote: >> >> have a look at the gnuplot 4.3-cvs demo: >> >> http://gnuplot.sourceforge.net/demo_4.3/smooth.html >> >> >> jamborta wrote: >>> >>> hi guys, >>> >>> I have a continuous random variable with around 1200 values. I'd like to >>> plot the distribution of that dataset. I guess I could set up some >>> intervals and count how many values fall into that interval. is that >>> doable with gnuplot? >>> >>> thanks, >>> tamas >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/plot-distribution-tp24593401p24607667.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |