From: Hans-Bernhard B. <HBB...@t-...> - 2012-10-01 22:11:55
|
On 01.10.2012 17:33, seb_kramm wrote: > While trying to plot a sawtooth wave (with 4.6 on Ubuntu), I noticed > that the following plot: > plot [0:10] x-floor(x) > produces some kind of vertical drifting, that gets magically reset at > the end of the plot (whatever the x range, actually). (see attached png) The attachment didn't make it past the mailing list processor. > This seems to be related to the number of samples. Indeed, 'set samples > 1000' solves the problem. But I was wondering if such a behaviour is > normal ? Yes, it is. Oh, and it's not the floor() function that's "drifting" here. To see what actually happens, I suggest you have a look at the output of set table plot [0:10] x - floor(x) and pay attention to both columns of data. And no, 'set samples 1000' didn't actually solve the problem. It just made it small enough so you no longer noticed it. The actual solution would have been more 'set samples 101'. To understand why. > I understand that the number of samples can be changed to set the plot > accuracy vs. computing time tradeoff, but I didn't expect that that > parameter could produce "wrong" results if incorrectly set. The thing to be learned here is that the result isn't actually wrong. It's just not what you expected. |