import matplotlib.pyplot as plt
from tenpy.models import lattice
fig, axes = plt.subplots(2, 2, sharex=True, sharey=True, figsize=(8, 6))
groups = [[(0, 1, 2)], [(0, 2, 1)],
        [(0, 2), (1,)], [(0, 2), (1,)]]
priorities = [None, None, None, [1, 0, 2]]
lat = lattice.Kagome(3, 3, None, bc='periodic')
for gr, prio, ax in zip(groups, priorities, axes.flatten()):
    order = lattice.get_order_grouped(lat.shape, gr, prio)
    lat.order = order
    lat.plot_order(ax, linestyle=':', linewidth=2)
    lat.plot_sites(ax)
    lat.plot_basis(ax, origin=-0.25*(lat.basis[0] + lat.basis[1]))
    ax.set_title(', '.join(['("grouped"', str(gr), str(prio) + ')']))
    ax.set_aspect('equal')
    ax.set_xlim(-1)
    ax.set_ylim(-1)
plt.show()