Tuning the magnetic anisotropy in single-layer crystal structures