% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/grip_plot.R
\name{plot.layout}
\alias{plot.layout}
\title{Quick plot for graph layouts}
\usage{
\method{plot}{layout}(x, ..., edges = NULL,
  projection = c("rgl", "ortho"), azimuth = 35, elevation = 22,
  vertex.col = "black", edge.col = "gray70")
}
\arguments{
\item{x}{Numeric coordinate matrix with at least two columns.}

\item{...}{Additional parameters passed to the underlying \code{plot()} call
for 2D layouts or the \pkg{rgl} 3D plotting call.}

\item{edges}{Optional two-column matrix of edges (1-based vertex ids).}

\item{projection}{Character string controlling how 3D layouts are displayed:
\code{"rgl"} (default) for an interactive \pkg{rgl} widget, or
\code{"ortho"} for a static orthographic projection via base graphics.
Ignored for 2D layouts.}

\item{azimuth}{Rotation around the vertical axis in degrees. Only used when
\code{projection = "ortho"}. Default 35.}

\item{elevation}{Rotation around the horizontal axis in degrees. Only used
when \code{projection = "ortho"}. Default 22.}

\item{vertex.col}{Colour(s) for the vertices. Recycled to match the number
of vertices. Default \code{"black"}.}

\item{edge.col}{Colour for the edges. Default \code{"gray70"}.}
}
\value{
NULL (called for side effects).
}
\description{
For 2D layouts, draws vertices and edges using base graphics.
For 3D layouts, the behaviour depends on the \code{projection} argument:
\describe{
  \item{\code{"rgl"} (default)}{Opens an interactive \pkg{rgl} scene when
    that package is installed. Falls back to \code{"ortho"} with a warning
    if \pkg{rgl} is not available.}
  \item{\code{"ortho"}}{Projects the 3D coordinates to 2D with
    \code{\link{project.3d}} and draws them with base graphics, giving
    a static figure suitable for vignettes and non-interactive reports.}
}
}
\examples{
edges <- cbind(1:5, 2:6)
coords <- grip(edges, n = 6, dim = 2,
                      placement = "barycenter",
                      rounds = 5, final_rounds = 5,
                      num_init = 3, num_nbrs = 4,
                      seed = 1)
plot.layout(coords, edges, main = "Path graph", pch = 16, cex = 0.8)
}
