| node_coords | R Documentation |
Computes axis locations of each node. This function can be helpful when you want to separately plot the node labels using the function mtext.
node_coords(edgelist, sorted = FALSE, decreasing = FALSE, ordering = NULL, labels = NULL)
edgelist |
basically a two-column matrix with edges
(see |
sorted |
logical to indicate if nodes should be sorted |
decreasing |
logical to indicate type of sorting
(used only when |
ordering |
optional numeric vector providing the ordering of nodes
(when provided, this parameter overrides |
labels |
character vector with labels for the nodes |
a vector with the location of nodes in the x-axis
Gaston Sanchez
arcplot
## Not run:
# generate a graph
some_graph = graph.ring(10)
# add names to nodes
V(some_graph)$name = letters[1:vcount(some_graph)]
# extract edgelist
edgelist = get.edgelist(some_graph)
# (default) arc diagram
arcplot(edgelist, labels=V(some_graph)$name, las=1)
# get x-axis coordinates of nodes
xcoords = node_coords(edgelist, labels=V(some_graph)$name)
# arc diagram with various labels
arcplot(edgelist, show.labels=FALSE, show.nodes=TRUE)
mtext(V(some_graph)$name, side=1, line=0, at=xcoords)
mtext(rep("node",10), side=1, line=1, at=xcoords, col="gray90")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.