|
From: Thomas S. <t.s...@fz...> - 2011-11-15 16:09:08
|
David Lindelöf <lindelof <at> ieee.org> writes: > I would like to plot the distribution of a variable and I follow the > directions given in the "Gnuplot in Action" book: > > I define a binning function: > > bin(x,s) = s*int(x/s) > > And then I use the plot command: > > plot './data.dat' u (bin($2, 0.2)):(1) smooth frequency > > However, the 'data.dat' file has a number of discontinuities in it > (i.e. blank lines). This causes the output to show several sets of > histograms, one for each continuous set of data. > > Is there any workaround for this? I would like the histogram to show > the distribution in the whole file, and to ignore discontinuities. maybe use an external program to omit the blank lines: plot '< awk "{if (NF) print}" ./data.dat' u (bin($2, 0.2)):(1) smooth frequency "awk" should be installed on every unix system, for windows systems google for 'awk windows'. |