File: layout_on_grid.Rd

package info (click to toggle)
r-cran-igraph 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,044 kB
  • sloc: ansic: 204,981; cpp: 21,711; fortran: 4,090; yacc: 1,229; lex: 519; sh: 52; makefile: 8
file content (83 lines) | stat: -rw-r--r-- 2,336 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/layout.R
\name{layout_on_grid}
\alias{layout_on_grid}
\alias{on_grid}
\title{Simple grid layout}
\usage{
layout_on_grid(graph, width = 0, height = 0, dim = 2)

on_grid(...)
}
\arguments{
\item{graph}{The input graph.}

\item{width}{The number of vertices in a single row of the grid. If this is
zero or negative, then for 2d layouts the width of the grid will be the
square root of the number of vertices in the graph, rounded up to the next
integer. Similarly, it will be the cube root for 3d layouts.}

\item{height}{The number of vertices in a single column of the grid, for
three dimensional layouts. If this is zero or negative, then it is
determinted automatically.}

\item{dim}{Two or three. Whether to make 2d or a 3d layout.}

\item{...}{Passed to \code{layout_on_grid()}.}
}
\value{
A two-column or three-column matrix.
}
\description{
This layout places vertices on a rectangular grid, in two or three
dimensions.
}
\details{
The function places the vertices on a simple rectangular grid, one after the
other. If you want to change the order of the vertices, then see the
\code{\link[=permute]{permute()}} function.
}
\examples{

g <- make_lattice(c(3, 3))
layout_on_grid(g)

g2 <- make_lattice(c(3, 3, 3))
layout_on_grid(g2, dim = 3)

plot(g, layout = layout_on_grid)
if (interactive() && requireNamespace("rgl", quietly = TRUE)) {
  rglplot(g, layout = layout_on_grid(g, dim = 3))
}
}
\seealso{
\code{\link[=layout]{layout()}} for other layout generators

Other graph layouts: 
\code{\link{add_layout_}()},
\code{\link{component_wise}()},
\code{\link{layout_}()},
\code{\link{layout_as_bipartite}()},
\code{\link{layout_as_star}()},
\code{\link{layout_as_tree}()},
\code{\link{layout_in_circle}()},
\code{\link{layout_nicely}()},
\code{\link{layout_on_sphere}()},
\code{\link{layout_randomly}()},
\code{\link{layout_with_dh}()},
\code{\link{layout_with_fr}()},
\code{\link{layout_with_gem}()},
\code{\link{layout_with_graphopt}()},
\code{\link{layout_with_kk}()},
\code{\link{layout_with_lgl}()},
\code{\link{layout_with_mds}()},
\code{\link{layout_with_sugiyama}()},
\code{\link{merge_coords}()},
\code{\link{norm_coords}()},
\code{\link{normalize}()}
}
\author{
Tamas Nepusz \email{ntamas@gmail.com}
}
\concept{graph layouts}
\keyword{graphs}