Pages

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:

6 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
  3. How about that we don't know the ylim for the two distributions? If they are different (the first one is less than the second)? Can we look the maximum ylim beforehand. Thanks.

    ReplyDelete
  4. Recently I've started working with R and I was looking for this.
    Thanks mate!

    ReplyDelete
  5. Titanium Hair dye - The Home of TITONIC-ART®
    A unique blend of titanium and titanium nail silicon has the everquest titanium finest texture titanium for sale and micro touch trimmer the lowest heat on the tin! grade 23 titanium

    ReplyDelete