Wednesday, February 5, 2014

ggPlot2: Histogram with jittered stripchart

Here is an example of a Histogram plot, with a stripchart (vertically jittered) along the x side of the plot.





Alternatively, using the geom_rug function:




Of course this simplicistic method need to be adjusted in vertical position of the stripchart or rugchart (y=-2, here), and the relative proportion of points jittering.

2 comments:

  1. can you also overlay a normal curve over the histograms, please

    ReplyDelete
  2. I'm a fan of ggplot2 and I like this post! So thank you!

    @Duleep Samuel : to easily overlay normal curve over histograms, you can use easyGgplot2 package. See this article : http://www.sthda.com/english/wiki/ggplot2-histogram-easy-histogram-graph-with-ggplot2-r-package

    ReplyDelete