Spin mapping at the nanoscale and atomic scale