A histogram visualizes the distribution of data. The $y$-axis may be specified as counts, relative frequency, or density. Relative frequency is simply proportions. Density means the height of the bars are such that the area of each bar is equal to the proportion of the data observed in each bin. Plotting histograms as density allows for comparison with the [[probability density function]] of one of the known [[distributions]]. ## R ```R hist(data, prob=T) ``` To overlay a known distribution ```R hist(data, prob=T) # sample the known distribution x <- seq(-3, 3, 0.01) # set values appropriate for distribution y <- dnorm(x) lines(x,y) ``` #diagram