Grid Graph Layout Method
Options
Description
Examples
center=list(numeric)
a point for the center of the grid. The origin is the default.
order=list({1,2,3})
the order in which to fill the grid, given in reverse priority. The default is 1,2,3 which fills the 3rd (z) axis first, then the 2nd (y) axis, then finally the x-axis. For two dimensions, the third value is ignored so the valid options are 1,2 (sweep up columns) and 2,1 (sweep across rows).
width=numeric
the width of the grid; 1.95 is the default.
The grid layout method evenly spaces the vertices of the graph along a grid in order starting in the corner in the negative direction, and filling in the positive direction on each axis in turn.
This layout method works in two or three dimensions and is best suited to very sparse graphs.
with⁡GraphTheory:
G≔Graph⁡undirected,1,2,1,4,2,3,3,4
G≔Graph 1: an undirected graph with 4 vertices and 4 edge(s)
DrawGraph⁡G,layout=grid
H≔RandomGraphs:-RandomGraph⁡20,40
H≔Graph 2: an undirected graph with 20 vertices and 40 edge(s)
DrawGraph⁡H,dimension=3,layout=grid
See Also
GraphTheory[DrawGraph]
Download Help Document