Many thanks Eik it works properly. what I don´t know exactly is why you put c(xv,rev(xv)),c(efinal,rev(efinal2)),col="red" inside polygon. I see it works but for the moment I don´t really see the meaning of c() and why is needed to put twice and so on.
If I had a vector of dates associated with each row (imagine t.csv) t<-read.csv("t.csv") tp<-as.Date(t[,2], format="%d/%m/%Y") I see that if I put plot(efinal, tp. ylim=range(c(efinal,efinal2)),type="n",ylab="") xv<-seq_along(efinal) polygon(c(xv,rev(xv)),c(efinal,rev(efinal2)),col="red") It doesn´t work. I can use xaxt="n" but it will be ok to put associated "date" on x axis. Sorry in advance if I only ask but it is difficoult to me, anyway many thanks and I will keep on trying. Many people (with some original reason) get ennoyed for some silly questions, so I send many thanks for read me and try to help me. Many, many thanks. 2012/8/2 Eik Vettorazzi <e.vettora...@uke.de> > Hi Jose, > this should work (but I think you need a deeper understanding, what > plot(efinal) does, see ?plot): > > plot(efinal,ylim=range(c(efinal,efinal2)),type="n",ylab="") > xv<-seq_along(efinal) > polygon(c(xv,rev(xv)),c(efinal,rev(efinal2)),col="red") > > cheers > > Am 02.08.2012 16:36, schrieb Jose Narillos de Santos: > > Hi I attach my function. No error message (it seems a line appears but > > nothing similar to examples(polygon)) > > > > > > > > 2012/8/2 Eik Vettorazzi <e.vettora...@uke.de <mailto:e.vettora...@uke.de > >> > > > > Hi Jose, > > how about this > > > > example(polygon) > > > > I think the second one is pretty much what you want. > > > > cheers. > > > > Am 02.08.2012 14:33, schrieb Jose Narillos de Santos: > > > 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? > > > > > > > > > > > > ______________________________________________ > > > R-help@r-project.org <mailto:R-help@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. > > > > > > > > > -- > > Eik Vettorazzi > > > > Department of Medical Biometry and Epidemiology > > University Medical Center Hamburg-Eppendorf > > > > Martinistr. 52 > > 20246 Hamburg > > > > T ++49/40/7410-58243 <tel:%2B%2B49%2F40%2F7410-58243> > > F ++49/40/7410-57790 <tel:%2B%2B49%2F40%2F7410-57790> > > > > -- > > Pflichtangaben gemäß Gesetz über elektronische Handelsregister und > > Genossenschaftsregister sowie das Unternehmensregister (EHUG): > > > > Universitätsklinikum Hamburg-Eppendorf; Körperschaft des > > öffentlichen Rechts; Gerichtsstand: Hamburg > > > > Vorstandsmitglieder: Prof. Dr. Guido Sauter (Vertreter des > > Vorsitzenden), Dr. Alexander Kirstein, Joachim Prölß, Prof. Dr. Dr. > > Uwe Koch-Gromus > > > > > > > -- > Eik Vettorazzi > > Department of Medical Biometry and Epidemiology > University Medical Center Hamburg-Eppendorf > > Martinistr. 52 > 20246 Hamburg > > T ++49/40/7410-58243 > F ++49/40/7410-57790 > > -- > Pflichtangaben gemäß Gesetz über elektronische Handelsregister und > Genossenschaftsregister sowie das Unternehmensregister (EHUG): > > Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen > Rechts; Gerichtsstand: Hamburg > > Vorstandsmitglieder: Prof. Dr. Guido Sauter (Vertreter des Vorsitzenden), > Dr. Alexander Kirstein, Joachim Prölß, Prof. Dr. Dr. Uwe Koch-Gromus > > [[alternative HTML version deleted]]
______________________________________________ R-help@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.