Scattered angular data which goes over [0:2pi] is underrepresented at the edges if plotted with smooth kdensity because up to one half of each kernel function lies outside of the range and gets discarded.
set xrange [0:2*pi]
set print $dat; do for [i=1:1000] { print rand(0)*2*pi }; set print
plot $dat us 1:(1) smooth kdensity
There should be an option angular or similar to smooth kdensity to "close the circle", wrapping (is that the right word?) each kernel function over the range limits zero and 2pi.
A similar effect could occur with dgrid3d, if an angle is plotted along a linear axis.
Good point, although I think your test case mostly shows that "smoothing" a uniform random distribution has little meaning. I have added a keyword "period" for the kdensity option. The documentation for
help kdensitynow says:Finally had a chance to give it a try, many thanks!