|
From: Ethan A M. <sf...@us...> - 2014-01-30 18:40:45
|
On Thursday, 30 January, 2014 17:30:32 Jon Gjengset wrote: > > Have a look at the running average demo: > > > > http://gnuplot.sourceforge.net/demo_4.6/running_avg.html > > > > Substituting an unwrap function for the avg5() function should do what > > you want. It would not require any changes to the executable code. > > Ah, yes, that should work nicely for now. > > > One problem I see is that the resulting plot would not stable when > > zoomed. Each change in xrange would potentially shift the whole curve > > on y by some multiple of 2π. > > This would certainly be true for continuous functions, but for data you > could potentially always unwrap the entire dataset and ignore the > xrange. > > I'm actually not entirely sure what you would expect as a user if you > zoomed in a generated plot with unwrapping enabled... > > > I don't think that adding a new function with a single argument is > > what you want. It seems to me this is more like a trivial smoothing > > operation, and the easiest fit into gnuplot's existing organization > > would be > > I agree, it does seem to fit more naturally as a smoothing operation. In > fact, if you have phase data, that is exactly what it does. > > > If you want to work on implementing this in the code, start by looking > > in plot2d.c for switch statements that handle SMOOTH_NONE or its > > alternatives. > > I'll have a look. > Is such a change something you would consider merging? Yes. The actual smoothing code will probably only require a few lines of C. The trickier part may be deciding whether or not it needs to be reexecuted on replot/refresh/zoom/unzoom. Ethan |