I'm trying to create a diagram with pgfplots. I have some data, which I'd like to have stored in the diagram code, alternatively (preferably not) in a separate file.
What I need to do is to calculate the cumulative percentage of the data. In other words, each data point is calculated by summing each of the numbers in the y column from the previous lines, dividing them by the sum of all numbers in the y column, and multiply by 100. For example, data point 3 would be calculated by (0 + 435 + 111 + 51) / 646 * 100 = 92%. (646 is the sum of all numbers in the y column)
Below are the numbers, and the diagram I'd like to create from them.
%x y 0 0 1 435 2 111 3 51 4 23 5 10 6 5 7 5 8 3 9 3
Thank you very much in advance!