plg is TDA's graph drawing command, and a different thing from
pltree: it takes the node coordinates and the edges and draws them,
with control over node shape and shading, edge curvature and arrowheads.
pltree by contrast computes a tree layout and draws edges only.
Arguments
- p
a
tda_pssession.- nodes
a data frame with the node positions. It needs
xandy;idnumbers the nodes, defaulting to the row number,greyandshapesetgs=andgt=,labela text string instead of the node number (str=),sizethe node's display size in mm (rd=), andlty,lw,fontsizeits line type, line width, and font size (lt=/lw=/fs=).- edges
a data frame of edges with
fromandto, holding node ids.curvesetsrd=, the radius that bends an edge,arrowa pair of arrowhead dimensions,labelthe value written on the edge (ic=),ltyits line type, which is how the two directions of a reciprocal pair are told apart,lwits line width,fontsizethe edge label's font size (fs=), andloop, for a self-edge, which side of the node it loops from (dir=).- ...
further options for
plg, e.g.nmax=(the maximum number of nodes, rarely needed since TDA's default of 100 is usually enough).
Examples
nodes <- data.frame(x = c(1, 3, 1, 3), y = c(2, 2, 1, 1))
edges <- data.frame(from = c(1, 1), to = c(2, 3))
p <- tda_ps(xlim = c(0, 4), ylim = c(0, 3), width = 40, height = 30)
p <- tda_pl_graph(p, nodes, edges)