Local control of magnetic anisotropy