The density function as a limit of histograms