Multiple histograms in a plot using ggplot2.

Be careful. The default value for the

parameter is different the histogram and density plot. So set the parameter explicitly.

Identity: overlap the two histograms.
stack: stack the two histograms on top of another.
For more options, check Position adjustments in
http://docs.ggplot2.org/current/index.html

Default parameters of histogram and density.

Multiple histograms in a plot using ggplot2 ggplot…
Tagged on:

Leave a Reply

Your email address will not be published. Required fields are marked *