From: Jon G. <jo...@th...> - 2014-01-30 23:52:22
|
> > s/x/$1/ > > Hmm. > "x" works for me. Unlesss "set parametric" is active, in which case "t" works. > But $1 is also correct. Ah, yes, it works for me with CVS as well. It wasn't working when I tried my patch on 4.6. > > Personally, I think what makes most sense is to not deal with > > plotting sampled functions as a special case. > > Agreed. I was originally worried that the unwrapping might apply only > to the data inside a selected zoom box, in which case it would suffer > the same shift of origin as you see for sampled functions. But your > code reevaluates the entire set of input data rather than just the > currently INRANGE data, so that problem is avoided. Yes, I thought it best to do it that way precisely to avoid the data jumping around too much. I suppose it might make the operation more costly for large datasets, but considering unwrapping is a fairly straightforward operation, I'm not too concerned. > > One separate note about the patch is that the line: > > lasty = M_PI; > > should possibly be changed to > > lasty = 0; > > Origin at 0 seems more obvious in the absence of data. > I have no idea which convention is more common for real world data sets. I've changed it to 0 in the patch now. Both conventions ([0,2π) and (-π,π]) are common in the real world. Wikipedia also points this out when they discuss unwrapping with regard to instantaneous phase[1]; they say "When phi(t), is constrained to its principal value, either the interval (-π, π] or [0, 2π), it is called the wrapped phase." I think sticking to 0 is marginally better because it will help move the y-intercept closer to the x-axis, but that's about it. Choosing 0 also means we don't have to justify choosing π. > Could you write up brief section for the documentation/help file? Done. Full patch against CVS attached. |