plot.poset {POSetR}R Documentation

Plotting the Hasse diagram of a poset

Description

plot produces an igraph object and shows the Hasse diagram.

Usage

## S3 method for class 'poset'
plot(
  x,
  vertex.color = rgb(1, 1, 1, 1),
  vertex.label = x$pointer$elements(),
  vertex.label.color = rgb(0, 0, 0, 1),
  vertex.label.family = "sans",
  edge.color = rgb(0, 0, 0, 1),
  edge.label = NA,
  edge.arrow.mode = "-",
  asp = 0,
  ...,
  equispaced = FALSE,
  show = TRUE
)

Arguments

x

an S4 object of class Rcpp_POSet, see poset for details.

vertex.color

argument of the plot.igraph function, see igraph.plotting for details.

vertex.label

argument of the plot.igraph function, see igraph.plotting for details.

vertex.label.color

argument of the plot.igraph function, see igraph.plotting for details.

vertex.label.family

argument of the plot.igraph function, see igraph.plotting for details.

edge.color

argument of the plot.igraph function, see igraph.plotting for details.

edge.label

argument of the plot.igraph function, see igraph.plotting for details.

edge.arrow.mode

argument of the plot.igraph function, see igraph.plotting for details.

asp

argument of the plot.igraph function, see igraph.plotting for details.

...

additional plotting parameters, see igraph.plotting for details.

equispaced

logical, if TRUE the nodes on the same level of the Hasse diagram are horizontally equispaced.

show

logical, if TRUE (default) the Hasse diagram is plotted.

Details

plot.poset computes the cover relation and produces the corresponding Directed Acyclic Graph (DAG), as an igraph object, returned as invisible output. Function layout_with_sugiyama generates the DAG layout with edges oriented from top to bottom. When equispaced=TRUE, nodes on the same Hasse diagram level are horizontally equispaced.

The Hasse diagram is displayed by a call to plot.igraph (some default argument values are set to get a cleaner plot, by exploiting Hasse diagram properties.

Setting show = FALSE produces the igraph object, without showing the Hasse diagram.

Note that

Value

an igraph object.

See Also

poset, igraph, igraph.plotting

Examples

dom <- matrix(c(
  "a", "b",
  "c", "b",
  "b", "d"
), ncol = 2, byrow = TRUE)
p <- poset(x = dom)
hasse <- plot(p)
class(hasse)

[Package POSetR version 1.1.4 Index]