How can I generate the following lattice graph?
You are welcome to make your own assumptions.
Is it possible to this using GridGraph
?
How can I generate the following lattice graph?
You are welcome to make your own assumptions.
Is it possible to this using GridGraph
?
GridGraph[{4, 4}, EdgeStyle -> White, VertexSize -> Medium,
VertexStyle -> White, Frame -> True, PlotRangePadding -> Scaled[.25]]
You can also use GraphComputation`EmptyGraph
:
Framed @ Show[GraphComputation`EmptyGraph[Range[16]],
ImageMargins -> Scaled[.05], ImageSize -> 300]
Using GraphLayout:
Graph[Range[16], {},
GraphLayout -> {"VertexLayout" -> {"GridEmbedding",
"Dimension" -> {4, 4}}, "PackingLayout" -> None},
VertexSize -> Medium, VertexStyle -> White, PlotRangePadding -> 1,
Frame -> True]
You can modify "Dimension" to change the shape:
Graph[Range[16], {},
GraphLayout -> {"VertexLayout" -> {"GridEmbedding",
"Dimension" -> {2, 8}}, "PackingLayout" -> None},
VertexSize -> Medium, VertexStyle -> White, PlotRangePadding -> 1,
Frame -> True]