[R] Polygon shaded area

Uwe Ligges ligges at statistik.tu-dortmund.de
Thu Aug 2 15:06:21 CEST 2012



On 02.08.2012 14:33, Jose Narillos de Santos wrote:
> Hi all,
>
> I have two vectors (columns) called "efinal" and "efinal 2".
>
> I want to plot them on the same plot and "draw" a shaded area beween the
> two lines using function polygon
>
> I have tried all but I don ´t understand the polygon area, can you help me
> with examples?
>
> plot(efinal,type="l",ylim=range(min(efinal2),
> max(efinal)),ylab="",main="plot")
>
> par(new=T)
> plot(efinal2,type="l",ylim=range(min(efinal2), max(efinal)),ylab="")
>
> The efinal are two temporal series I attach?


Don't know, at least not attached to the message through R-help.

I don't see what the problem is to construct a polygon()
Just insert x and y values of both series in an appropriate order and 
connect them at the end.

If you fail, provide fully reproducible code (we do not have efinal nor 
efinal 2 for now).

Best,
Uwe Ligges








>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list