The variations in the depth direction such as orientation, lattice constant and composition that occur on the surface of thin film can be analyzed non-destructively using the in-plane X-ray diffraction method with Rigaku's SmartLab multipurpose diffractometer. In the in-plane diffraction method, X-rays penetrate the surface of a thin-film sample at a glazing angle. By controlling the incident angle precisely, the depth of X-rays entering the sample can be controlled. In the example shown in the figure below, as the incident angle increases only the top surface layer is observed at first. Then GaN appears and, when the incident angle increases, the signals from the GaAs substrate begin to appear.