[Kst] plotting cumulative sum of vector

Mark Dammer mark.dammer at googlemail.com
Thu Sep 13 20:15:47 UTC 2012


Hi Nicolas,
thanks for the reply. In the meantime I got it sorted by myself. Thanks
for your help anyway.
BTW: Are there any plans for a python scripting interface for KST ?
Would be great as Python is becoming more and more popular in scientific
computing.

all the best, Mark

On 13/09/12 20:38, Nicolas Brisset wrote:
> Hi Mark,
>
> sorry it took so long to answer, we're usually much faster. But somehow your mail disappeared under a pile of new messages...
>> I want to create a plot of all elements of a vector cumulatively
>> summed
>> up to see the overall trend:
>> Old Vector: 1,2,-3,6,9,...
>> Plotted New Vector: 1,3,0,6,15,...
>> Can this be achieved with KST2 and how ?
> Yes
>> I found the Cumulative Sum plugin, but that returns a scalar and not
>> a vector.
> The Cumulative Sum plugin is correct and should return a vector. I have just tested it and it works if you select a step of 1.0 as each new point is computed as previous_sum + step*new_point.
> It seems that the default step is 0.0, which is not really good. I'll change it.
> The only "problem" is that the returned vector has a size of n+1 (the first point being 0.0), so if you plot it against the same x vector as the origin vector the curve will have interpolated points.
> I wonder whether the first point should not be the same as the first point of the input vector to keep the size the same. Does anybody have objections or can I make that change?
>
> Nicolas
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst



More information about the Kst mailing list