Bonjour Hi everybody, Firs of all, sorry for my terrible English, I would like to know if it?s possible to create an ?empty plot? in which i could add two ablines I created on two different plots earlyer in my script. As a result I would like to have a plot with only the two ablines (in the same plot) but without the graphs I used to create the ablines in the first place. I hope I explained my problem well enough. Thanks for helping me out, i hope someone has the answer. Adrien Bonvin [[alternative HTML version deleted]]
On Dec 5, 2014, at 12:30 AM, Adrien Bonvin wrote:> Bonjour > Hi everybody, > > Firs of all, sorry for my terrible English, > > I would like to know if it?s possible to create an ?empty plot? in which i could add two ablines I created on two different plots earlyer in my script. > > >Read there help page for ?plot.default. There is a type parameter that lets you do what you ask. There's also a worked example on ?plot.window> > As a result I would like to have a plot with only the two ablines (in the same plot) but without the graphs I used to create the ablines in the first place. > > I hope I explained my problem well enough. > > Thanks for helping me out, i hope someone has the answer. > > Adrien Bonvin > [[alternative HTML version deleted]]Please read what the posting guide says about html posting.> > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.David Winsemius Alameda, CA, USA
plot.new() abline(0,1) abline(1,1) # or as Michael suggest plot(1:10, 1:10, type = "n") # then abline(0,1) abline(1,1) Best Matteo Murenu, Cagliari, IT -----Original Message----- From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of David Winsemius Sent: 05 December 2014 10:07 To: Adrien Bonvin Cc: r-help at r-project.org Subject: Re: [R] Put 2 ablines in an "empty plot" On Dec 5, 2014, at 12:30 AM, Adrien Bonvin wrote:> Bonjour > Hi everybody, > > Firs of all, sorry for my terrible English, > > I would like to know if it's possible to create an "empty plot" in which icould add two ablines I created on two different plots earlyer in my script.> > >Read there help page for ?plot.default. There is a type parameter that lets you do what you ask. There's also a worked example on ?plot.window> > As a result I would like to have a plot with only the two ablines (in thesame plot) but without the graphs I used to create the ablines in the first place.> > I hope I explained my problem well enough. > > Thanks for helping me out, i hope someone has the answer. > > Adrien Bonvin > [[alternative HTML version deleted]]Please read what the posting guide says about html posting.> > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.David Winsemius Alameda, CA, USA ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
The following example may give you an idea regarding your question. Please see what happens by typing the codes > x <- seq(from=-5, to=5, by=1) > y1 <- 0 + 0.5*x > y2 <- 0 - 0.5*x > > plot(x,y1, type="n") > points(x,y1) > points(x,y2) > abline(a=0, b=0.5) > abline(a=0, b=-0.5) Is this what you are looking for? I hope this helps. Chel Hee Lee On 12/05/2014 02:30 AM, Adrien Bonvin wrote:> Bonjour > Hi everybody, > > > > > Firs of all, sorry for my terrible English, > > I would like to know if it?s possible to create an ?empty plot? in which i could add two ablines I created on two different plots earlyer in my script. > > > > > As a result I would like to have a plot with only the two ablines (in the same plot) but without the graphs I used to create the ablines in the first place. > > I hope I explained my problem well enough. > > Thanks for helping me out, i hope someone has the answer. > > Adrien Bonvin > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. >