% 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}
\alias{plot.kmlearningpathmatrices}
\alias{plot.kmlearningpathmatrix}
\alias{plot.kmsurmisefunction}
\title{Plot a Hasse diagram}
\usage{
\method{plot}{kmfamset}(
  x,
  ...,
  state = NULL,
  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 = NULL,
  verbose = 0
)

\method{plot}{kmsurmiserelation}(
  x,
  ...,
  horizontal = FALSE,
  colors = NULL,
  keepNames = TRUE,
  vertexshape = "circle",
  arrowhead = "none",
  arrowtail = "none",
  verbose = 0
)

\method{plot}{kmlearningpathmatrices}(
  x,
  ...,
  horizontal = FALSE,
  colors = NULL,
  keepNames = TRUE,
  itemsep = ",",
  braces = TRUE,
  vertexshape = "oval",
  arrowhead = "none",
  arrowtail = "none",
  edgelabel = FALSE,
  verbose = 0,
  structure = NULL,
  pathcolors = c("red", "blue", "gold", "deeppink", "brown", "violet", "green")
)

\method{plot}{kmlearningpathmatrix}(
  x,
  ...,
  horizontal = FALSE,
  colors = NULL,
  keepNames = TRUE,
  itemsep = ",",
  braces = TRUE,
  vertexshape = "oval",
  arrowhead = "none",
  arrowtail = "none",
  edgelabel = FALSE,
  verbose = 0,
  structure = NULL,
  pathcolor = "blue"
)

\method{plot}{kmsurmisefunction}(
  x,
  ...,
  space = FALSE,
  horizontal = FALSE,
  colors = "Beige",
  keepNames = TRUE,
  itemsep = ",",
  braces = TRUE,
  vertexshape = "oval",
  arrowhead = "none",
  arrowtail = "none",
  edgelabel = FALSE,
  verbose = 0,
  highlightcolor = "red"
)
}
\arguments{
\item{x}{Binary matrix representing a family of sets}

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

\item{state}{Knowledge state whose neighbourhood is to be pictured
(Default `NULL``)

If \code{state} is \code{NULL}, the neighbourhood is depicted as a 'normal'
family of sets (\code{kmfamset}) and a respective warning is issued.}

\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{structure}{Knowledge structure within which the path shall be depicted}

\item{pathcolors}{Colors for the individual learning paths}

\item{pathcolor}{Colors for the individual learning paths (default: blue)}

\item{space}{Should basis or space de depicted? (default FALSE)}

\item{highlightcolor}{Color for highlighting}
}
\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.

If the KST object to be plotted is a family of sets (\code{kmfamset}) \strong{and}
a \code{state} is specified, the \code{colors} vector must have four elements, (i)
the color for the state, (ii) the color for its upper neighbours, (iii)
the color for its lower neighbours, and (iv) the color for all other states.
}
\examples{
\dontrun{
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 Functions for plotting and printing knowledge structures:
\code{\link[=kmcolors]{kmcolors()}},
\code{\link[=kmprettyprint]{kmprettyprint()}}
}
\concept{Functions for plotting and printing knowledge structures}
