Using gnuplot for discrete distribution -
is there relatively simple way plot graph of distribution of discrete data?
e.g. have set of float values on range 0 1 , need chart diagram on 10 ranges ([0.0, 0.1], [0.1, 0.2], ..., [0.9, 1.0]) of how many of given floats hit respective range.
thanks.
this can done "frequency plot". if frequency option set "all points same x-value replaced single point having summed y-values" (help smooth frequency). means if assign every point y-value 1 result number of points having particular x-value.
now, in order able sum points within range can use function rounds off values of data as suggested here
bin(x)=0.1*floor(x/0.1) plot "datafile.txt" using (bin($1)):(1.0) smooth frequency boxes
you might want tweak appearance of boxes set boxwidth
, set style fill
.
Comments
Post a Comment