[R] Overlapping plot in lattice

Kang Min ngokangmin at gmail.com
Sun Oct 2 14:56:14 CEST 2011


Thanks Gabor, that was exactly what I needed.

On Sep 30, 9:00 pm, Gabor Grothendieck <ggrothendi... at gmail.com>
wrote:
> On Fri, Sep 30, 2011 at 3:01 AM, Kang Min <ngokang... at gmail.com> wrote:
> > Hi all,
>
> > I was wondering if there's an equivalent to par(new=T) of the plot
> > function in lattice. I'm plotting an xyplot, and I would like to
> > highlight one point by plotting that one point again using a different
> > symbol.
>
> > For example, where 6 is highlighted:
> > plot(1:10, xlim=c(0,10), ylim=c(0,10))
> > par(new=T)
> > plot(6,6, xlim=c(0,10), ylim=c(0,10), pch=16)
>
> Try this:
>
> library(lattice)
> xyplot(1:10 ~ 1:10, xlim=c(0,10), ylim=c(0,10))
> trellis.focus()
> panel.points(6, 6, pch = 6)
> trellis.unfocus()
>
> --
> Statistics & Software Consulting
> GKX Group, GKX Associates Inc.
> tel: 1-877-GKX-GROUP
> email: ggrothendieck at gmail.com
>
> ______________________________________________
> R-h... at r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list