plotnet | R Documentation |
This function plots traffic networks, where the relative locations of nodes are meaningful (unlike conceptual networks).
plotnet(
nodes.x,
nodes.y,
link.node.matrix,
radius = 1/2,
link.sep = 1/12,
link.label.offset = 0.4,
LABEL.CEX = 1,
ARROW.LENGTH = 0.4,
ARR.TYPE = "triangle",
node.label = TRUE,
LINK.LABEL = TRUE,
RightAbove = F,
link.lty = 1,
link.col = 1,
node.lwd = 2
)
nodes.x |
Vector of x-coordinates for node locations |
nodes.y |
Vector of y-coordinates for node locations |
link.node.matrix |
Two column matrix specifying nodes of origin and destination for each link |
radius |
Radius of circles marking node locations. Defaults to 0.5. |
link.sep |
Angular separation (as a fraction of pi radians) of entry/exit positions of bi-directional links. Defaults to 1/12. |
link.label.offset |
Controls position of link labels relative to link. Detauls to 0.4. |
LABEL.CEX |
Character expansion factor for link labels. Defaults to 1. |
ARROW.LENGTH |
Controls length of arrow heads. Defaults to 0.4. |
ARR.TYPE |
Controls appearance of arrow heads in Arrows function. Defaults to "triangle". |
node.label |
Label nodes? Defaults to TRUE. |
LINK.LABEL |
Label links? Defaults to TRUE. |
RightAbove |
Further control for link label positions. Defaults to FALSE, which means that labels appear to left looking in direction of arrows. If TRUE, labels appear to the left/above links. |
link.lty |
Line type for links: single value, or vector (lty per link). Defaults to 1. |
link.col |
Line type for links: single value, or vector (lty per link). Defaults to 1 (black). |
node.lwd |
Line width for nodes: single value, or vector (lty per nodes). Defaults to 2. |
Produces a plot of the network
nodes.x <- c(2,7,12,2,7,12)
nodes.y <- c(7,7,7,2,2,2)
link.node.matrix <- rbind(c(1,2),c(1,4),c(2,5),c(3,2),c(3,6),c(4,5),c(6,5))
plotnet(nodes.x,nodes.y,link.node.matrix,ARROW.LENGTH=0.3,link.sep=0,radius=0.7,RightAbove=T)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.