Friday, March 1, 2013

Overlapping Histogram in R

While preparing a class exercise involving the use of overlaying of histogram, I searched Google on possible article or discussion on the said topic. Luckily, I found a blog where the author demonstrated an R function to create an overlapping histogram. However, a comment from a guy also showed the same output using transparency. Below were the sample codes that can be used to generate overlapping histogram in R as based on the blog and the viewers comment.

                                                                                                                                     



                                                                                                                        
Here are the codes:

3 comments:

  1. Of course, for the transparency to have any effect, you would have to use an image file format that actually supports it, e.g. PNG or PDF. In R, you can do this easily using the png() or pdf() functions.

    ReplyDelete
  2. Nice post! Love this, a very useful tool to have.

    Thanks!

    ReplyDelete
    Replies
    1. Thanks Doug! I am happy that others like my post and found it useful.

      Delete