Hi, I want to change line and marker type using par() function (my example is taken from bigger function) oldpar<-par(no.readonly=TRUE) par(type="b",lty=1) plot(x1,col=1) par(type="b",lty=2) lines(x2,col=2) par(oldpar) # restore plotting parameters First line is drawn only with circles (no line) Second line is drawn only line but not circles. Where is problem? Jakub Zlamal -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On 27 Sep 2002 at 8:30, zlamal at ufi.fme.vutbr.cz wrote:> Hi, > I want to change line and marker type using par() function (my > example is taken from bigger function)What is your real intention?> > oldpar<-par(no.readonly=TRUE) > par(type="b",lty=1) > plot(x1,col=1)you can use plot(x1,type="b",lty=1,col=1)> par(type="b",lty=2) > lines(x2,col=2)lines(x2,col=2,lty=2) points(x2,pch=1,col=2) to get desired effect without bothering with par() setting, but it need not to suit your real intention.> par(oldpar) # restore plotting parameters > > First line is drawn only with circles (no line) > Second line is drawn only line but not circles. > > Where is problem? > > Jakub ZlamalRegards Petr Pikal petr.pikal at precheza.cz p.pik at volny.cz -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> What is your real intention?Real intention to do this is to pass line type arguments to function which calls plot and lines as an argument, as shown bellow. xx<-function(type){ plot(c(1,2,3),c(3,4,5),type) } xx(c(type="b",lty=1)) This solution can not be used, but I can pass arguments to par function par(type) Jakub Zlamal -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._