The lognormal distribution can have a very long tail (i.e., even for large y
the prob(y) > 0
and not vanishing.
If you want to compare your pdf plot to those of e.g., the wiki web page, you will need to ignore the tail.
bins = linspace(0,5,500);
n = hist( y, bins );
bar( bins(1:end-1), n(1:end-1)/N ); axis([0 bins(end-1) 0 1]); % discard last bin that has the "tail"