Re: [R] Second y-axis --- alternative to par(new=

2009-10-08 Thread jim holtman
What you need to do is to specify that you don't want labels on the second plot: ## (2) Does plot points where (x-axis) they should be xlim - range(x1) plot(x1, y1, type=l, xlim=xlim) par(new=TRUE) plot(x2, y2, type=p, xlim=xlim, xlab='', ylab='', axes=FALSE) axis(4) On Wed, Oct 7, 2009 at 4:29

[R] Second y-axis --- alternative to par(new=

2009-10-07 Thread Rainer M Krug
Hi is there an alternative to par(new), for ading data to a plot for a different y-axis? My problem with par(new=TRUE) is, that it re-defines all axis and labels (as in example 1) and one has to use xlim=... to fix the x-axis. I am looking for something, which simply resets the y-axis, so that a

Re: [R] Second y-axis --- alternative to par(new=

2009-10-07 Thread Rainer M Krug
On Wed, Oct 7, 2009 at 11:28 AM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi Try ?twoord.plot from plotrix package. Thanks Petr - I was not aeware of this command. But I would prefer a more general solution. An example on where I am using is, to plot a histogram overlayed by its density

Re: [R] Second y-axis --- alternative to par(new=

2009-10-07 Thread Petr PIKAL
r-help-boun...@r-project.org napsal dne 07.10.2009 11:37:22: On Wed, Oct 7, 2009 at 11:28 AM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi Try ?twoord.plot from plotrix package. Thanks Petr - I was not aeware of this command. But I would prefer a more general solution. An example

Re: [R] Second y-axis --- alternative to par(new=

2009-10-07 Thread Rainer M Krug
On Wed, Oct 7, 2009 at 11:53 AM, Petr PIKAL petr.pi...@precheza.cz wrote: r-help-boun...@r-project.org napsal dne 07.10.2009 11:37:22: On Wed, Oct 7, 2009 at 11:28 AM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi Try ?twoord.plot from plotrix package. Thanks Petr - I was

Re: [R] Second y-axis --- alternative to par(new=

2009-10-07 Thread Petr PIKAL
Hi Rainer M Krug r.m.k...@gmail.com napsal dne 07.10.2009 12:09:21: On Wed, Oct 7, 2009 at 11:53 AM, Petr PIKAL petr.pi...@precheza.cz wrote: r-help-boun...@r-project.org napsal dne 07.10.2009 11:37:22: On Wed, Oct 7, 2009 at 11:28 AM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi

Re: [R] Second y-axis --- alternative to par(new=

2009-10-07 Thread Rainer M Krug
On Wed, Oct 7, 2009 at 12:26 PM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi Rainer M Krug r.m.k...@gmail.com napsal dne 07.10.2009 12:09:21: On Wed, Oct 7, 2009 at 11:53 AM, Petr PIKAL petr.pi...@precheza.cz wrote: r-help-boun...@r-project.org napsal dne 07.10.2009 11:37:22: On

Re: [R] Second y-axis --- alternative to par(new=

2009-10-07 Thread Petr PIKAL
Hi Rainer M Krug r.m.k...@gmail.com napsal dne 07.10.2009 12:40:39: On Wed, Oct 7, 2009 at 12:26 PM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi Rainer M Krug r.m.k...@gmail.com napsal dne 07.10.2009 12:09:21: snip In the meantime, what about x - rnorm(200) hist(x, col =

Re: [R] Second y-axis --- alternative to par(new=

2009-10-07 Thread Rainer M Krug
On Wed, Oct 7, 2009 at 1:48 PM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi Rainer M Krug r.m.k...@gmail.com napsal dne 07.10.2009 12:40:39: On Wed, Oct 7, 2009 at 12:26 PM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi Rainer M Krug r.m.k...@gmail.com napsal dne 07.10.2009

Re: [R] Second y-axis --- alternative to par(new=

2009-10-07 Thread cls59
Rainer M Krug-6 wrote: Thanks - but if I want to have the histogram with counts (freq=TRUE), then I have exactly the situation I was talking about - sorry for not being clear: x - rnorm(200) hist(x, col = blue, freq = TRUE) lines(density(x), col = red, lwd = 2) i.e. left y-axis

Re: [R] Second y-axis --- alternative to par(new=

2009-10-07 Thread cls59
cls59 wrote: # recovering par('xaxp') uses the original x limits. plot.window( xlim = range( par('xaxp')[1:2] ), ylim = range( density(x)$y )) Actually, I misspoke. I believe the following is the voodoo you want for exactly recovering the original xlimit: plot.window( xlim =