Self-patterned molecular photoswitching in nanoscale surface assemblies.