1. A method comprising: fast two-dimensional scanning a layered nanostructure with a scanning electron microscope to form a structure image having multiple layers; slow-rate scanning the nanostructure along selected lines, collecting characteristic spectra; extracting chemical profiles of the nanostructure from the spectra; transforming the structure image into a warped structure image by flattening each of the layers in the structure image; aligning the coordinates of the chemical profiles to those of the warped structure image; averaging the chemical profiles obtained from different line scans; expanding the averaged profiles into warped chemical maps; and inversely transforming the warped chemical maps respectively into two-dimensional chemical maps.