I'm plotting the vertex degree (# of incident edges) of the graph g
.
deg <- degree(g, v=V(g), mode = c("in"), loops = TRUE)
histdata <- hist( deg, breaks=1000, plot=FALSE )
plot(histdata$count, log="xy", type="p", col="blue", bg = "blue", pch=20,
xlim=c(1,max(deg)),
ylim=c(1,max(histdata$count)),
ylab="Frequency", xlab="Degree")
This code plots this scatterplot,
which is very close to what I need but has a few issues:
1) the x labels are wrong, as they don't represent the degrees but the histogram breaks.
2) the axis bars are messy. How can I remove the empty ones?
3) how can I plot a regression line? I tried with abline
a开发者_如何转开发nd lm(histdata$mids~histdata$count)
but nothing gets plotted.
Thanks for any hint!
UPDATE: this plot is probably plain wrong. See http://www.hpl.hp.com/research/idl/papers/ranking/ranking.html
精彩评论