This is the data and code used in the manuscrpit "Multi-species coexistence in fragmented landscapes" by Mingyu Luo, Shaopeng Wang, Serguei Saavedra, Dieter Ebert, and Florian Altermatt.