% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.R
\name{plot.igraph}
\alias{plot.igraph}
\alias{plot.graph}
\title{Plotting of graphs}
\usage{
\method{plot}{igraph}(
  x,
  axes = FALSE,
  add = FALSE,
  xlim = NULL,
  ylim = NULL,
  mark.groups = list(),
  mark.shape = 1/2,
  mark.col = rainbow(length(mark.groups), alpha = 0.3),
  mark.border = rainbow(length(mark.groups), alpha = 1),
  mark.expand = 15,
  mark.lwd = 1,
  loop.size = 1,
  ...
)
}
\arguments{
\item{x}{The graph to plot.}

\item{axes}{Logical, whether to plot axes, defaults to FALSE.}

\item{add}{Logical scalar, whether to add the plot to the current device, or
delete the device's current contents first.}

\item{xlim}{The limits for the horizontal axis, it is unlikely that you want
to modify this.}

\item{ylim}{The limits for the vertical axis, it is unlikely that you want
to modify this.}

\item{mark.groups}{A list of vertex id vectors. It is interpreted as a set
of vertex groups. Each vertex group is highlighted, by plotting a colored
smoothed polygon around and \dQuote{under} it. See the arguments below to
control the look of the polygons.}

\item{mark.shape}{A numeric scalar or vector. Controls the smoothness of the
vertex group marking polygons. This is basically the \sQuote{shape}
parameter of the \code{\link[graphics:xspline]{graphics::xspline()}} function, its possible
values are between -1 and 1. If it is a vector, then a different value is
used for the different vertex groups.}

\item{mark.col}{A scalar or vector giving the colors of marking the
polygons, in any format accepted by \code{\link[graphics:xspline]{graphics::xspline()}}; e.g.
numeric color ids, symbolic color names, or colors in RGB.}

\item{mark.border}{A scalar or vector giving the colors of the borders of
the vertex group marking polygons. If it is \code{NA}, then no border is
drawn.}

\item{mark.expand}{A numeric scalar or vector, the size of the border around
the marked vertex groups. It is in the same units as the vertex sizes. If a
vector is given, then different values are used for the different vertex
groups.}

\item{mark.lwd}{A numeric scalar or vector, the linewidth of the border around
the marked vertex groups.  If a
vector is given, then different values are used for the different vertex
groups.}

\item{loop.size}{A numeric scalar that allows the user to scale the loop edges
of the network. The default loop size is 1. Larger values will produce larger
loops.}

\item{\dots}{Additional plotting parameters. See \link{igraph.plotting} for
the complete list.}
}
\value{
Returns \code{NULL}, invisibly.
}
\description{
\code{plot.igraph()} is able to plot graphs to any R device. It is the
non-interactive companion of the \code{tkplot()} function.
}
\details{
One convenient way to plot graphs is to plot with \code{\link[=tkplot]{tkplot()}}
first, handtune the placement of the vertices, query the coordinates by the
\code{\link[=tk_coords]{tk_coords()}} function and use them with \code{\link[=plot]{plot()}} to
plot the graph to any R device.
}
\section{Related documentation in the C library}{
\href{https://igraph.org/c/html/0.10.17/igraph-Structural.html#igraph_get_edgelist}{\code{get_edgelist()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_incident}{\code{incident()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_edges}{\code{edges()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_vcount}{\code{vcount()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Structural.html#igraph_is_loop}{\code{is_loop()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_is_directed}{\code{is_directed()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Nongraph.html#igraph_convex_hull_2d}{\code{convex_hull_2d()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_ecount}{\code{ecount()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_get_eids}{\code{get_eids()}}
}

\examples{

g <- make_ring(10)
plot(g, layout = layout_with_kk, vertex.color = "green")

}
\seealso{
\code{\link[=layout]{layout()}} for different layouts,
\link{igraph.plotting} for the detailed description of the plotting
parameters and \code{\link[=tkplot]{tkplot()}} and \code{\link[=rglplot]{rglplot()}} for other
graph plotting functions.

Other plot: 
\code{\link{rglplot}()}
}
\author{
Gabor Csardi \email{csardi.gabor@gmail.com}
}
\concept{plot}
\keyword{graphs}
