Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

network.edgelabel

Plots a label corresponding to an edge in a network plot.


Description

Draws a text labels on (or adjacent to) the line segments connecting vertices on a network plot.

Usage

network.edgelabel(px0, py0, px1, py1, label, directed, loops = FALSE,
  cex, curve = 0, ...)

Arguments

px0

vector of x coordinates of tail vertex of the edge

py0

vector of y coordinates of tail vertex of the edge

px1

vector of x coordinates of head vertex of the edge

py1

vector of y coordinate of head vertex of the edge

label

vector strings giving labels to be drawn for edge edge

directed

logical: is the underlying network directed? If FALSE, labels will be drawn in the middle of the line segment, otherwise in the first 3rd so that the labels for edges pointing in the opposite direction will not overlap.

loops

logical: if true, assuming the labels to be drawn belong to loop-type edges and render appropriately

cex

numeric vector giving the text expansion factor for each label

curve

numeric vector controling the extent of edge curvature (0 = straight line edges)

...

additional arguments to be passed to text

Details

Called internally by plot.network when edge.label parameter is used. For directed, non-curved edges, the labels are shifted towards the tail of the edge. Labels for curved edges are not shifted because opposite-direction edges curve the opposite way. Makes a crude attempt to shift labels to either side of line, and to draw the edge labels for self-loops near the vertex. No attempt is made to avoid overlap between vertex and edge labels.

Value

no value is returned but text will be rendered on the active plot

Author(s)

skyebend


network

Classes for Relational Data

v1.16.1
GPL (>= 2)
Authors
Carter T. Butts [aut, cre], David Hunter [ctb], Mark Handcock [ctb], Skye Bender-deMoll [ctb], Jeffrey Horner [ctb], Li Wang [ctb]
Initial release
2020-10-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.