Hi! I need to plot two lines on the same graph. I do plot(x,y) then plot(x,z,add=TRUE) but I get the following warning messages Warning messages: 1: parameter "add" couldn't be set in high-level plot() function 2: parameter "add" couldn't be set in high-level plot() function 3: parameter "add" couldn't be set in high-level plot() function 4: parameter "add" couldn't be set in high-level plot() function 5: parameter "add" couldn't be set in high-level plot() function 6: parameter "add" couldn't be set in high-level plot() function Thanks for your help. -- myriam -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> I need to plot two lines on the same graph. I do > plot(x,y) > then > plot(x,z,add=TRUE)Maybe try using the par(new=TRUE) parameter, as in: plot(x,y) par(new=TRUE) plot(x,z) Hope that helps! ------------------------------------------------------------------------ Wolfgang Viechtbauer wviechtb at s.psych.uiuc.edu Department of Quantitative Psychology viechtba at students.uiuc.edu University of Illinois, Champaign-Urbana [Virus based on an honors- Room 409, Psychology Building system: Forward this to 10 603 E. Daniel Street random people and delete a Champaign, IL 61820 bunch of your files. Thanks.] -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
I think if you want to add a line (or superimpose a line) onto a plot you want to use lines(). So what you want is: plot( x, y ) lines( x, z ) If you want to add some texts, then use text(), legend() for a legend, title() for axis labels/titles. Hope this helps, Ko-Kang Wang ---------------------------------------------- Ko-Kang Kevin Wang Head of Statistical Analysis Division Software Developers' Klub (SDK) University of Auckland Auckland New Zealand -----Original Message----- From: owner-r-help at stat.math.ethz.ch [mailto:owner-r-help at stat.math.ethz.ch]On Behalf Of Myriam Abramson Sent: Wednesday, August 29, 2001 2:30 PM To: r-help at stat.math.ethz.ch Subject: [R] newbie graphics question Hi! I need to plot two lines on the same graph. I do plot(x,y) then plot(x,z,add=TRUE) but I get the following warning messages Warning messages: 1: parameter "add" couldn't be set in high-level plot() function 2: parameter "add" couldn't be set in high-level plot() function 3: parameter "add" couldn't be set in high-level plot() function 4: parameter "add" couldn't be set in high-level plot() function 5: parameter "add" couldn't be set in high-level plot() function 6: parameter "add" couldn't be set in high-level plot() function Thanks for your help. -- myriam -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Please read the help and try the example provided in the command "lines()". Carlos Ortega. -----Mensaje original----- De: Myriam Abramson [mailto:mabramso at gmu.edu] Enviado el: mi?rcoles 29 de agosto de 2001 4:30 Para: r-help at stat.math.ethz.ch Asunto: [R] newbie graphics question Hi! I need to plot two lines on the same graph. I do plot(x,y) then plot(x,z,add=TRUE) but I get the following warning messages Warning messages: 1: parameter "add" couldn't be set in high-level plot() function 2: parameter "add" couldn't be set in high-level plot() function 3: parameter "add" couldn't be set in high-level plot() function 4: parameter "add" couldn't be set in high-level plot() function 5: parameter "add" couldn't be set in high-level plot() function 6: parameter "add" couldn't be set in high-level plot() function Thanks for your help. -- myriam -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
james.holtman at convergys.com wrote:> > Here is the help page from R indicating what 'par' parameters can not be > set with the 'high-level' commands. 'new' is one of these: > > All but these R.O. and the following low-level arguments can be > set as well in high-level and mid-level plot functions, such asYes, thanks to you & Gavin Simpson & Brian Ripley for making this clear. However, I was not asking how to use 'plot'. Instead, I was pointing out that the text of the help system is less than ideal in this case. Perhaps I am not expecting enough effort from the user, but it seems to me that the user should not have to read the "details" section on a second command in order to get the valid list of arguments for the first command, which in this case means finding out that about 1/3 of the 60 or so 'par' arguments are not valid for 'plot'. The help on "plot" could be changed to say something like "graphics parameters can be set from 'plot', except when they can't (for restrictions, see 'DETAILS' for 'par')", or "*some* graphics parameters can be set from 'plot'", but instead, it just indicates that graphics parameters can be set from 'plot'. Arlin -- Arlin Stoltzfus (arlin at carb.nist.gov) Research Biologist, NIST; Adj. Asst. Prof., UMBI CARB, 9600 Gudelsky Dr., Rockville, Md 20850 ph. 301 738-6208; fax 301 738-6255; http://www.molevol.org/camel -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Thanks for all the responses. FWIW, the par(new=TRUE) does rescale the graph as opposed to lines(...) so it's more appropriate in the general case. Yep, I do find the documentation rather terse. For example, I haven't been able to rescale the axes properly. I have 30 data points but I want the x-axis to read from 0 to 3000. How is that done? What I've tried from looking at the ?axis documentation does not work and then my y-axis is messed up. TIA. -- myriam -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._