|
From: <pl...@pi...> - 2007-10-24 12:44:14
|
On Wed, 24 Oct 2007 13:43:22 +0200, Levente Novák <ln...@dr...> wrote: > On Mon, 2007-10-22 at 13:51 +0200, Juergen Wieferink wrote: > >> There is a new assignment operator (and a comma operator), so you >> can plot something like: >> >> old_x = NaN >> plot 'test.dat' using 1:(dx=$1-old_x,old_x=$1,dx) >> > > First of all, thanks to everybody who helped me! I succeeded in > approximating the differential of data files the following way, using > Jürgen's example: > > # Approximation of the first derivative of x-y data > # by the method: (y(n)-y(n-1))/(x(n)-x(n-1)) > > old_x = NaN > old_y = NaN > plot 'something.dat' using 1:(dx=$1-old_x,dy=$2-old_y,old_x=$1,old_y= > $2,dy/dx) > > Just to let know to whom it may be useful. Maybe a small demo file could > be written to demonstrate its use (I am pleased to post such a demo if > this is OK). > > Thanks again, folks! > > Levente > Glad you found this feature useful. It's quite new so it needs some different uses to see if does all that's needed, thanks. if you want to post that as an example it should probably by plotting against ($1+old_x)/2 to prevent a shift in the position of the derivative. BTW the running mean example also suffers from this defect as is clearly seen in the plot that Ethan linked to. The running mean is offset 2.5 data points to the right. regards. |