+++
title = "Finite square lattice"
weight = 20
+++

### Finite square lattice

In this example, the lattice is finite, consisting of 40 times 40 unit cells.
Otherwise the sample model is the same as in the
 [basic square lattice example](/ref/sample/struct/2d/lattice2d/square-lattice).

{{< galleryscg >}}
{{< figscg src="/img/draw/SquareLattice30deg_setup.jpg" width="350px" caption="Real-space model">}}
{{< figscg src="/img/auto/scatter2d/FiniteSquareLattice.png" width="500px" caption="Scattering intensity">}}
{{< figscg src="/img/auto/scatter2d/SquareLattice.png" width="500px" caption="For comparison, scattering intensity with infinite lattice">}}
{{< /galleryscg >}}

{{< show-ex file="scatter2d/FiniteSquareLattice.py" >}}
