I will leave the xray difraction pattern for others.
I want to clear up this :
2.Why do we compare electron diffraction pattern to X-ray diffraction pattern when studying about wave-particle duality of matter?
The simplest electron diffraction pattern is the double slit experiment one electron at a time.
electron built up over time
We see how the probability wavelike nature is built up by individual hits of electrons
This can be compared with a double slit experiment one photon at a time:
So when treating electrons and photons one at a time, the diffraction pattern appears in the probability of finding the particle at the (x,y) of the screen.
It so happens that light (zillion of photons) shows the same interference pattern as single photon accumulation. It is a mathematical effect that is based on the maxwell equations.
The wave nature of the electron appears only when single electrons traverse matter. What waves is the pobability, not the energy of mass of the electron.
Light being a superposition of zillions of photons displays the diffraction pattern of energy waves going through a medium .