[R] Line histogram for a matrix

David Winsemius dwinsemius at comcast.net
Thu Jun 2 20:39:58 CEST 2011


On Jun 2, 2011, at 11:04 AM, Sakti wrote:

> Hi guys!
>
> I'm new to R, but I was wondering if one could plot many histograms  
> into a
> single graph each having a different color. To make things clear:
>
> Suppose you have a matrix of 100 rows and 10 columns. I'm interested  
> in
> plotting the histogram for each row, but it should not appear as  
> bars but
> rather as lines connecting the points of the frequencies. Now, I  
> want to do
> this for the 100 rows and make all histogram lines appear with  
> different
> colors into the same graph.

You should look at the matplot function.

>
> The graph should look something like:
>
> http://robjhyndman.com/Rfiles/animation/frmale191.jpg
> http://robjhyndman.com/Rfiles/animation/frmale191.jpg
>
> but instead of those values should be more like histogram shape.
>
> How can you do it???
>
> Thanks!!!
>


David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list