I have a graph and I want to plot the distribution of degrees. Example:
> library(igraph)
> g <- make_ring(10)
> degree(g)
[1] 2 2 2 2 2 2 2 2 2 2
> g2 <- sample_gnp(1000, 10/1000)
> degree_distribution(g2)
[1] 0.000 0.000 0.001 0.008 0.017 0.045 0.061 0.096 0.103 0.133 0.127 0.102 0.103 0.069 0.046 0.039 0.026 0.012 0.007
[20] 0.000 0.003 0.002
I want to plot the degrees distribution with log scale, more or less as in the image below: