[R] xyplot, type="b"

Sundar Dorai-Raj sundar.dorai-raj at pdf.com
Wed Jun 21 06:26:23 CEST 2006


I think Paul's suggestion works if you use:

  panel.points(x, y, col = "white", cex = 1.5, pch = 16, ...)

instead of the default background color. For me
trellis.par.get("background")$col returns "transparent".

HTH,

--sundar

Benjamin Tyner wrote:
> I can imagine the intended effect of this, but for some reason it does
> not work as expected--the 'gaps' do not show up (I'm using 2.3.0). Also,
> I think it would have to be tweaked to prevent overlapping for points
> very close together. Incidentally, the benefit I seek is most pronounced
> with pch=".", as then one gets the best of both worlds.
> 
> Ben
> 
> Paul Murrell wrote:
> 
> 
>>Is this what you mean ... ?
>>
>>dat<-data.frame(x=1:10,y=1:10,z=sample(letters[1:3],10,T))
>>xyplot(y~x | z, data = dat,
>>      panel = function(x, y, ...) {
>>        panel.lines(x, y, ...)
>>        panel.points(x, y, col=trellis.par.get("background")$col,
>>                     cex=1.5, pch=16, ...)
>>        panel.points(x, y, ...)
>>      })
>>
>>Paul
>>
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



More information about the R-help mailing list