r - How to plot degree of network -


how can plot degree graoh that? enter image description here

the picture indicative, result may not identical image. important thing on x axis there labels of nodes , on y axis degree of each node.

then degree can represented histogram (figure), points, etc., not important.

this tried , did not come close want:

d = degree(net, mode="all") hist(d) 

or

t = table(degree(net)) plot(t, xlim=c(1,77), ylim=c(0, 40), xlab="degree", ylab="frequency") 

i think trivial thing it's first time use r.

thank you


this have now: enter image description here graph more readable (i have 77 bars). is, more space between bars , between labels.

my aim show how node (valjean) has higher value other, don't know if using right graphic..

you can use barplot , specify row names. example,

net = rgraph(10) rownames(net) = colnames(net) = letters[1:10] d = degree(net) barplot(d, names.arg = rownames(net)) 

Comments