Atomic force microscopy and near-field optical imaging of a spin transition.