I found the figure below in literature about assortativity (for networks). I would like to plot my network in a similar way with R & igraph
.
Every point on the graph corresponds to a network edge. In my case x axis should represent the source node's degree, y axis the target node's degree. I am a beginner in R and therefore would very much appreciate if someone could help me to plot this.
I now used the code from Vincent Zoonekynd and got the figure below. However I think that it still doesn't show exactly the right thing. The nodes on the axis should be ranked by their degree. When I look at the plot, I see some nodes with high degree which are plased around axis mark 42, 100 or 175. This makes not much sense. Is there something wrong with the rank process here?
A <- get.adjacency(USAN_g_num)
image(A, ylim=c(0,627))
i <- rank( degree(USAN_g_num), na.last=NA, ties.method="first" )
image(A[i,i], ylim=c(0,627))
(I added an ylim to the code so that both, low-low degrees and high-high degrees are plottet in the same corner bottom-left and upper-right)
But it is correct that my plot should look different from the one I showed above, since my data is disassortative.