series allignment
Posted: Tue Dec 28, 2004 11:03 pm
we are trying to generate a series showing the derivative of a plot. The
original seris is called lineseries, and the derivative series is called deriv series. we are apporximating the deirvative at each point as one-half the difference of point[n+1] and point[n-1] which is good enough for what we need. we have to add a point at start and end with y=0 because derivative is not calculated at end points. Now, all is well except that the direvative plot is displaced relative to the line plot by 10 units to
the left. We gernerated a data set which is a "square wave", which is
a run of DN=125 followed by a run of DN=0 and then repeat. Clearly,
the two series are not in sync. Could use your advice here.
************************************************************
derivseries.addXY(lineseries.xvalues[0],0,'',clTeeColor);
N:=lineseries.count-1;
For kk:=1 To Pred(N) Do
derivseries.addXY(lineseries .xvalues[kk],
(lineseries.yvalues[kk+1]-lineseries.yvalues[kk-1]/2),
'',clTeeColor);
derivseries.addXY(lineseries.xvalues[N],0,'',clTeeColor);
**********************************************************
Thanks,
Jennifer
original seris is called lineseries, and the derivative series is called deriv series. we are apporximating the deirvative at each point as one-half the difference of point[n+1] and point[n-1] which is good enough for what we need. we have to add a point at start and end with y=0 because derivative is not calculated at end points. Now, all is well except that the direvative plot is displaced relative to the line plot by 10 units to
the left. We gernerated a data set which is a "square wave", which is
a run of DN=125 followed by a run of DN=0 and then repeat. Clearly,
the two series are not in sync. Could use your advice here.
************************************************************
derivseries.addXY(lineseries.xvalues[0],0,'',clTeeColor);
N:=lineseries.count-1;
For kk:=1 To Pred(N) Do
derivseries.addXY(lineseries .xvalues[kk],
(lineseries.yvalues[kk+1]-lineseries.yvalues[kk-1]/2),
'',clTeeColor);
derivseries.addXY(lineseries.xvalues[N],0,'',clTeeColor);
**********************************************************
Thanks,
Jennifer