We present and discuss single crystal diffraction of synchrotron radiation for mapping of domains and domain walls in ferroelectric and antiferroelectric crystals. Dedicated in-situ sample cells allow probing structural evolution as a function of electric field, temperature, and strain. Diffraction data reveal a clear picture of domain configurations via Bragg reflection pattern while, via diffuse scattering, an information about deviations from the average structure and domain walls becomes available. Among other examples, the emphasis will be given to the phase transitions in Pb(Zr,Ti)O3 crystals (2.4% of Zr) as a function of temperature and electric field. For this case, diffraction experiments helped to develop an effective domain engineering scheme to control AFE domain patterns.