[R] shading line plot

David Winsemius dwinsemius at comcast.net
Tue Aug 7 21:52:07 CEST 2012


On Aug 6, 2012, at 10:46 PM, Akhil dua wrote:

> Hi everyone,
>
> I have a time series data set and I want to fill my line plot of  
> this time
> series with different colors
>
> e.g
> I want to fill portion related to 1995-1996 with blue , portion  
> related to
> 1996-1997 with orange and then portion related to 1997-1998 with red

Take a look at the plotrix package. It has a variation of the  
`segments` function that supports varying colors.

-- 

David Winsemius, MD
Alameda, CA, USA



More information about the R-help mailing list