Share the Gallery !Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInEmail this to someone

Histograms allow to study the distribution of a continuous variable. Do not confound it with barplot! Using ggplot2, it means you need to specify only a x position in aes() and call geom_histogram. You can easily custom the width of each bin as proposed below:

It is easy to custom colors. Here is two examples: one setting an uniform color for every bin, and another with a color following the height of the bin. Note that as usual, color set the color of the border. Use fill for the color of the bin itself.

Not what you are looking for ? Make a new search !



Leave a Reply

Be the First to Comment!

Notify of