% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.R
\name{plot}
\alias{plot}
\alias{plot.kmfamset}
\alias{plot.kmneighbourhood}
\alias{plot.kmsurmiserelation}
\title{Plot a Hasse diagram}
\usage{
\method{plot}{kmfamset}(
  x,
  ...,
  horizontal = FALSE,
  colors = NULL,
  keepNames = TRUE,
  itemsep = ",",
  braces = TRUE,
  vertexshape = "oval",
  arrowhead = "none",
  arrowtail = "none",
  edgelabel = FALSE,
  verbose = 0
)

\method{plot}{kmneighbourhood}(
  x,
  ...,
  horizontal = FALSE,
  colors = c("#eeee00", "#aaccff", "#bbffbb"),
  keepNames = TRUE,
  itemsep = ",",
  braces = TRUE,
  vertexshape = "oval",
  arrowhead = "none",
  arrowtail = "none",
  edgelabel = FALSE,
  state,
  verbose = 0
)

\method{plot}{kmsurmiserelation}(
  x,
  ...,
  horizontal = FALSE,
  colors = NULL,
  keepNames = TRUE,
  vertexshape = "circle",
  arrowhead = "none",
  arrowtail = "none",
  verbose = 0
)
}
\arguments{
\item{x}{Binary matrix representing a family of sets}

\item{...}{Optional inherited parameters}

\item{horizontal}{Boolean defining orientation of the graph, default FALSE}

\item{colors}{Color value or vector (default NULL).}

\item{keepNames}{Keep item names (default TRUE)}

\item{itemsep}{Item separator in sets (default ','; only for families
of states)}

\item{braces}{Put braces around vertices (default TRUE; only for
families of states)}

\item{vertexshape}{Shape of the vertex objects, e.g. circle, oval, box, or none. See
\href{https://graphviz.org/doc/info/shapes.html}{Graphviz Node Shapes}
for a complete list of possible values.}

\item{arrowhead}{Form of the arrow head, e.g. vee or none (default). See
\href{https://graphviz.org/docs/attr-types/arrowType/}{Graphviz Arrow
Types} for a complete list of possible values. This may be used for vertical
graphs although none is the standard there.}

\item{arrowtail}{Form of the arrow tail, e.g. vee or none (default). See
\href{https://graphviz.org/docs/attr-types/arrowType/}{Graphviz Arrow
Types} for a complete list of possible values. This should be used for
horizontal graphs.}

\item{edgelabel}{Boolean whether to label the edges of the diagram
(default FALSE)}

\item{verbose}{Verbosity level (0 (default), 1, or 2)}

\item{state}{Knowledge state whose neighbourhood is to be pictured}
}
\description{
\code{plot} draws a Hasse diagram for a family of sets or a surmise relation.
}
\details{
\code{plot} takes a matrix representing a family of sets (knowledge states)
or a surmise relation and a color vector, and draws a Hasse diagram.
If the color vector is NULL the states are drawn in green, the items in
the relation are drawn in orange.

For a surmise relation, if there are equivalent items, they are contracted
into one vertex labelled 'a ~ b ~ ...' for equivalent items a, b, ...

If the plot is to be used within a Shiny app, it must be included with
\code{grVizOutput()} and \code{renderGrViz()} from the \code{DiagrammeR}
package (\code{plotOutput()} and \code{renderPlot()} do not work).

Please note that, for equivalent items in a relation plot, the prerequisites
are lost.
}
\examples{
plot(phsg$basis)

sp <- kmunionclosure(phsg$basis)
n <- kmneighbourhood(phsg$basis[3,], sp, include=TRUE)
plot(n, state=phsg$basis[3,])

m <- matrix(c(1,0,0,1,1,1,1,1,1), ncol=3, byrow=FALSE)
class(m) <- unique(c("kmsurmiserelation", class(m)))
plot(m, vertexshape="oval")

}
\seealso{
Other Plotting knowledge structures: 
\code{\link{kmcolors}()}
}
\concept{Plotting knowledge structures}
