|
From: Pavel S. <ps...@tw...> - 2013-04-23 08:12:44
|
Hi, I have been trying to plot frequency-like plot for my data but failed with both smooth kdensity/frequency approaches. The input data are in the range of 0-15000, each value can be present multiple times. I tried to use the traditional trick for histogram plotting: bw=10 set boxwidth bw bin(x, width) = width*floor(x/width) + bw/2.0 plot [0:15000]"data" u (bin(\$1, bw)):(1.0) smooth freq w boxes The problem is that instead of boxes I need just top line connecting the middle point of each histogram bin. Of course, just using "with lines" in the above won't work - in case some bin is empty, the line does not go to zero but connects to first nonempty bin, which gives wrong result. Any idea how to workaround this? I tried to use smooth kdensity, which would give me similar enough representation but clearly bandwidths like 1,5,10 are too small for ranges around 10^5 and the output graph is just garbage. I guess that's because I got under sampling frequency used by some interpolation functions behind the scenes. Any way how could I increase that sampling value? Thanks for any hints, Pavel |