# layout.grid

From igraph v0.6.5-2
by Gabor Csardi

##### Simple grid layout

This layout places vertices on a rectangulat grid, in two or three dimensions.

- Keywords
- graphs

##### Usage

```
layout.grid (graph, width = 0)
layout.grid.3d (graph, width = 0, height = 0)
```

##### Arguments

- graph
- The input graph.
- width
- The number of vertices in a single row of the grid. If
this is zero or negative for
`layout.grid`

, then 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, - 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.

##### Details

These functions place the vertices on a simple rectangular grid, one
after the other. If you want to change the order of the vertices, then
see the `permute.vertices`

function.

##### Value

- A two-column matrix for
`layout.grid`

, a three-column matrix for`layout.grid.3d`

.

##### concept

Graph layout

##### See Also

`layout`

for other layout generators

##### Examples

```
g <- graph.lattice( c(3,3) )
layout.grid(g)
g2 <- graph.lattice( c(3,3,3) )
layout.grid.3d(g2)
plot(g, layout=layout.grid)
rglplot(g, layout=layout.grid.3d)
```

*Documentation reproduced from package igraph, version 0.6.5-2, License: GPL (>= 2)*

### Community examples

Looks like there are no examples yet.