Skip to content
Advertisement

Plot cumulative distribution with networkx and numpy

I want to implement the cumulative distribution for a graph. Here is my code:

JavaScript

To plot cumulative I know that I must have at the x-axis the degree and in the y-axis the samples with value > Degree. The result using my code is the following: Wrong plot

But the expected result must be something like this: True

I am not sure if I am getting the expected plot using my code. Can anyone help me and explain me if is something wrong?

Advertisement

Answer

I believe it should be:

JavaScript

Full code:

JavaScript

Usually when implementing cumulative degree distributions you want the total number of counts until a given degree, P(K<k).

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement