[R] newbie graphics question

Gavin Simpson gavin.simpson at ucl.ac.uk
Wed Aug 29 17:01:22 CEST 2001


You need to read the help for par (as mentioned in the help for plot).

In the details section the help states that:

     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 as
     `plot', `points', `lines', `axis', `title', `text', `mtext':

        *  `"ask"'

<snip>

        *  `"new"'

<snip>

Which is why your command didn't work.

Gav

-----Original Message-----
From: owner-r-help at stat.math.ethz.ch
[mailto:owner-r-help at stat.math.ethz.ch] On Behalf Of Arlin Stoltzfus
Sent: 29 August 2001 14:48
To: r-help at stat.math.ethz.ch
Subject: Re: [R] newbie graphics question


Wolfgang Viechtbauer wrote:
> 
> > 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)

This works, but isn't the real issue here why the help indicates 
that graphics parameters set by par can also be passed as arguments 
to "plot", when in fact this isn't true?  That is, according to 
the help, I ought to be able to set "new" like this: 

 > plot ( x, y1 )
 > plot ( x, y2, new=TRUE )
 Warning messages: 
 1: parameter "new" couldn't be set in high-level plot() function 
 2: parameter "new" couldn't be set in high-level plot() function 
 3: parameter "new" couldn't be set in high-level plot() function 
 4: parameter "new" couldn't be set in high-level plot() function 
 5: parameter "new" couldn't be set in high-level plot() function 
 6: parameter "new" couldn't be set in high-level plot() function 

but this doesn't work.

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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._._._

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list