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
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
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.
>
On Wed, Oct 7, 2009 at 1:48 PM, Petr PIKAL wrote:
> Hi
>
> Rainer M Krug napsal dne 07.10.2009 12:40:39:
>
> >
>
> > On Wed, Oct 7, 2009 at 12:26 PM, Petr PIKAL
> wrote:
> > Hi
> >
> > Rainer M Krug napsal dne 07.10.2009 12:09:21:
> >
> > >
> >
>
>
>
> > In the meantime, what about
> >
> > x
Hi
Rainer M Krug napsal dne 07.10.2009 12:40:39:
>
> On Wed, Oct 7, 2009 at 12:26 PM, Petr PIKAL
wrote:
> Hi
>
> Rainer M Krug napsal dne 07.10.2009 12:09:21:
>
> >
>
> In the meantime, what about
>
> x <- rnorm(200)
> hist(x, col = "blue", freq = TRUE)
> ddd<-density(x)
> lines(ddd$
On Wed, Oct 7, 2009 at 12:26 PM, Petr PIKAL wrote:
> Hi
>
> Rainer M Krug napsal dne 07.10.2009 12:09:21:
>
> >
>
> > On Wed, Oct 7, 2009 at 11:53 AM, Petr PIKAL
> 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
> >
Hi
Rainer M Krug napsal dne 07.10.2009 12:09:21:
>
> On Wed, Oct 7, 2009 at 11:53 AM, Petr PIKAL
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
> wrote:
> >
> > > Hi
> > >
> > > Try ?twoord.plot from plotrix package.
On Wed, Oct 7, 2009 at 11:53 AM, Petr PIKAL 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
> wrote:
> >
> > > Hi
> > >
> > > Try ?twoord.plot from plotrix package.
> > >
> > >
> > Thanks Petr - I was not aeware of this comm
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
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
On Wed, Oct 7, 2009 at 11:28 AM, Petr PIKAL 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 estimate (easier to di
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 n
At 07:50 19/08/2009, you wrote:
Dear R-help,
I recently discovered lattice xyplot, but have been struggling with
plotting a second y-axis. I am able to do this with plot() but can't
figure it out in xyplot. Any help would be appreciated.
I have found help on adding a second Y-axis when the data
Dear R-help,
I recently discovered lattice xyplot, but have been struggling with plotting a
second y-axis. I am able to do this with plot() but can't figure it out in
xyplot. Any help would be appreciated.
I have found help on adding a second Y-axis when the data is all part of the
same data fra
Hi list,
In the following code, how can I place the percentage label away from
numbers in the second y-axis (lets say all should be inside plot area)?
Thanks
Alireza
=
require(grid)
vp<- viewport(x=.1,y=.1,width=.6,height=.6,just=c("left", "bottom"))
pushViewport(vp)
plotDATA=data
14 matches
Mail list logo