Correlation between the domain structure and ferroelectricity in PbTiO3 thin films