Hallo, All, I cannot add one straight vertical line at 0.0 on x axis using the following data and R code: y<-c(0.037790309,0.020307312,0.021109653,0.050216689, 0.026979484,0.027619193,0.024070163,0.021996969, 0.007831769,0.020065109,0.005903177,0.008182403) d<-data.frame(cbind(y,seq(1:12))) colnames(d)<-c("y","x") attach(d) plot(y,x,xlab="",ylab="",axes=F) abline(v=c(0.0),lty=2) axis(1) axis(3) Any help with be greatly appreciated! Legen -- View this message in context: http://www.nabble.com/Plot-with-a-vertical-line-at-zero-on-x-axis-tp24174761p24174761.html Sent from the R help mailing list archive at Nabble.com.
You need to specify the xlim: y<-c(0.037790309,0.020307312,0.021109653,0.050216689, 0.026979484,0.027619193,0.024070163,0.021996969, 0.007831769,0.020065109,0.005903177,0.008182403) d<-data.frame(cbind(y,seq(1:12))) colnames(d)<-c("y","x") #--attach(d) plot(d$y,d$x,xlab="",ylab="",axes=F, xlim=c(0, max(d$y))) abline(v=c(0.0),lty=2) axis(1) axis(3) On Tue, Jun 23, 2009 at 5:26 PM, legen <legendy@gmail.com> wrote:> > Hallo, All, > > I cannot add one straight vertical line at 0.0 on x axis using the > following > data and R code: > > y<-c(0.037790309,0.020307312,0.021109653,0.050216689, > 0.026979484,0.027619193,0.024070163,0.021996969, > 0.007831769,0.020065109,0.005903177,0.008182403) > d<-data.frame(cbind(y,seq(1:12))) > colnames(d)<-c("y","x") > attach(d) > plot(y,x,xlab="",ylab="",axes=F) > abline(v=c(0.0),lty=2) > axis(1) > axis(3) > > Any help with be greatly appreciated! > > Legen > > -- > View this message in context: > http://www.nabble.com/Plot-with-a-vertical-line-at-zero-on-x-axis-tp24174761p24174761.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? [[alternative HTML version deleted]]
I got it. Thank you very mcuh. Legen jholtman wrote:> > You need to specify the xlim: > > y<-c(0.037790309,0.020307312,0.021109653,0.050216689, > 0.026979484,0.027619193,0.024070163,0.021996969, > 0.007831769,0.020065109,0.005903177,0.008182403) > d<-data.frame(cbind(y,seq(1:12))) > colnames(d)<-c("y","x") > #--attach(d) > plot(d$y,d$x,xlab="",ylab="",axes=F, xlim=c(0, max(d$y))) > abline(v=c(0.0),lty=2) > axis(1) > axis(3) > > > On Tue, Jun 23, 2009 at 5:26 PM, legen <legendy at gmail.com> wrote: > >> >> Hallo, All, >> >> I cannot add one straight vertical line at 0.0 on x axis using the >> following >> data and R code: >> >> y<-c(0.037790309,0.020307312,0.021109653,0.050216689, >> 0.026979484,0.027619193,0.024070163,0.021996969, >> 0.007831769,0.020065109,0.005903177,0.008182403) >> d<-data.frame(cbind(y,seq(1:12))) >> colnames(d)<-c("y","x") >> attach(d) >> plot(y,x,xlab="",ylab="",axes=F) >> abline(v=c(0.0),lty=2) >> axis(1) >> axis(3) >> >> Any help with be greatly appreciated! >> >> Legen >> >> -- >> View this message in context: >> http://www.nabble.com/Plot-with-a-vertical-line-at-zero-on-x-axis-tp24174761p24174761.html >> Sent from the R help mailing list archive at Nabble.com. >> >> ______________________________________________ >> 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<http://www.r-project.org/posting-guide.html> >> and provide commented, minimal, self-contained, reproducible code. >> > > > > -- > Jim Holtman > Cincinnati, OH > +1 513 646 9390 > > What is the problem that you are trying to solve? > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. > >-- View this message in context: http://www.nabble.com/Plot-with-a-vertical-line-at-zero-on-x-axis-tp24174761p24177769.html Sent from the R help mailing list archive at Nabble.com.