% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/motifs-extract.R
\name{plot.cograph_motif_analysis}
\alias{plot.cograph_motif_analysis}
\title{Plot Motif Analysis Results}
\usage{
\method{plot}{cograph_motif_analysis}(
  x,
  type = c("triads", "types", "significance", "patterns"),
  n = 20,
  colors = c("#2166AC", "#B2182B"),
  res = 72,
  node_size = 5,
  label_size = 7,
  title_size = 7,
  stats_size = 5,
  ncol = 5,
  legend = TRUE,
  color = "#800020",
  spacing = 1,
  combined = TRUE,
  ...
)
}
\arguments{
\item{x}{A \code{cograph_motif_analysis} object from \code{\link[=extract_motifs]{extract_motifs()}}}

\item{type}{Plot type:
\describe{
\item{\code{"triads"}}{(default) Network diagrams of specific named triads,
arranged in a grid. Each cell shows the three nodes and their edges.}
\item{\code{"types"}}{Bar chart of MAN type frequencies.}
\item{\code{"significance"}}{Z-score plot showing over- and under-represented
types. Requires \code{significance = TRUE} in \code{extract_motifs()}.}
\item{\code{"patterns"}}{Abstract MAN pattern diagrams showing edge
structure of each triad type without specific node labels.}
}}

\item{n}{Number of triads/patterns to show. Default 20.}

\item{colors}{Two-element color vector mapped to a three-tone significance
scale (used by \code{type = "significance"} and by \code{type = "patterns"}
node fills): \code{colors[1]} fills items that are significantly
under-represented (\code{p < .05} and \code{z < 0}); \code{colors[2]}
fills items that are significantly over-represented (\code{p < .05} and
\code{z > 0}); everything else is filled neutral grey (\code{"#9E9E9E"}).
When significance was not run, patterns nodes use \code{colors[1]} as a
single fill. Default \code{c("#2166AC", "#B2182B")} (blue for under, red
for over).}

\item{res}{Resolution for scaling (kept for backwards compatibility). Default 72.}

\item{node_size}{Size of nodes in triad diagrams (1-10 scale). Default 5.}

\item{label_size}{Font size for node labels (3-letter abbreviations). Default 7.}

\item{title_size}{Font size for motif type title (e.g., "120C"). Default 7.}

\item{stats_size}{Font size for statistics text (n, z, p). Default 5.}

\item{ncol}{Number of columns in the plot grid. Default 5.}

\item{legend}{Show abbreviation legend at bottom? Default TRUE.}

\item{color}{Color for nodes, edges, and labels in triad diagrams.
Default \code{"#800020"} (maroon).}

\item{spacing}{Spacing multiplier between grid cells (0.5-2). Default 1.}

\item{combined}{Logical: when TRUE (default) and \code{type = "patterns"},
arrange the per-motif panels in an internal grid via
\code{graphics::par(mfrow=...)}. Set to FALSE to draw into a layout the
caller has already configured (e.g. via \code{\link{panel_layout}()}).}

\item{...}{Additional arguments (unused).}
}
\value{
Invisibly returns NULL for triad and pattern plots, or a ggplot2
object for types and significance plots.
}
\description{
Create visualizations for motif analysis results including network diagrams
of triads, bar plots of type distributions, and significance plots.
}
\examples{
mat <- matrix(c(0,3,2,0, 0,0,5,1, 0,0,0,4, 2,0,0,0), 4, 4, byrow = TRUE)
rownames(mat) <- colnames(mat) <- c("Plan","Execute","Monitor","Adapt")
m <- extract_motifs(mat, significance = FALSE)
plot(m)
plot(m, type = "types")

}
\seealso{
\code{\link[=extract_motifs]{extract_motifs()}} for the analysis that produces this object,
\code{\link[=motif_census]{motif_census()}} for statistical motif analysis

Other motifs: 
\code{\link{extract_motifs}()},
\code{\link{extract_triads}()},
\code{\link{get_edge_list}()},
\code{\link{motif_census}()},
\code{\link{motifs}()},
\code{\link{plot.cograph_motifs}()},
\code{\link{subgraphs}()},
\code{\link{triad_census}()}
}
\concept{motifs}
