from tenpy import SpinHalfSite
from tenpy.models import CouplingMPOModel
import matplotlib.pyplot as plt

class MyModel(CouplingMPOModel):
    def init_sites(self, model_params):
        return SpinHalfSite()

    def init_terms(self, model_params):
        # note: terms dont matter for this plot, so we simplify here
        self.add_onsite(1., 0, 'Sz')

model = MyModel({'lattice': 'Square', 'Lx': 2, 'Ly': 3})
plt.figure(figsize=(5, 6))
ax = plt.gca()
model.lat.plot_coupling(ax)
model.lat.plot_sites(ax)
model.lat.plot_order(ax)
plt.show()