I know two methods to simulate a PDF from random data samples using MATLAB :
1) Using a histogram where I use this command histogram(data,'Normalization','pdf'), it gives PDF like bins.
2) Another one is using kernel density estimation
From (1) I get a PDF in bin format and from another (2), I get a continuous(smooth) PDF that I can match with my analytical derived PDF. I have seen in some scientific/engineering papers they plot simulated PDFs like the one given in the figure below: where red is the simulated PDF and blue is analytical. I want to know how one gets shaky simulated PDF like this and do they offer any benefits. May be represent data much clearly, have very small bins?