[R] newbie graphics question

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Aug 29 16:56:01 CEST 2001


On Wed, 29 Aug 2001, Arlin Stoltzfus wrote:

> 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

Which help?  ?plot.default says

     ...: graphical parameters as in `par' may also be passed as
          arguments.

and that has a xref to ?par which says

     <highlevel plot> (..., <tag> = <value>)

      ...

     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"'

        *  `"fig"', `"fin"'

        *  `"mai"', `"mar"', `"mex"'

        *  `"mfrow"', `"mfcol"', `"mfg"'

        *  `"new"'

        *  `"oma"', `"omd"', `"omi"'

        *  `"pin"', `"plt"', `"ps"', `"pty"'

        *  `"usr"'

        *  `"xlog"', `"ylog"'




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

`as documented'

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

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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