A series of PZT based ferroelectric thin films obtained by multitarget sputtering with different preferential orientations are studied by piezoresponse force microscopy (PFM). The modification of the substrate by the deposition of an extra TiO x layer, and the use of MgO-based substrates instead of the usual Si-based ones, change the preferential orientation of the films. The results of the analysis of the local piezoelectric properties allow us to discuss the origin of some special features observed, like the appearance of protruding grains in films with specific orientations, and the homogeneity of the piezoelectric performance at the nanoscale.