[R] How to xyplot without borders

Peter Ehlers ehlers at ucalgary.ca
Thu Jan 27 15:54:29 CET 2011


On 2011-01-27 03:34, Juan Andres Hernandez wrote:
> Hello I have the following data.frame and xyplot. I need this plot without
> the borders. Does anybody know how to get this xyplot without borders o with
> white borders?
> Thank's in advance
> Juan Hernández
>
>   my.label<- data.frame(quantil=rep(20,8),
> my.factor=factor(c('FA','FB','FC','FD','FE','FG','FH','FI')))
>
>   library(lattice)
>   graf.my.label<- xyplot(my.factor ~ quantil, data = my.label,
> aspect = 'fill',xlab = "",ylab='',xlim=c(0,103),
>    scales=list(x=list(alternating=0 ),tick.number = 2,tck=0),
> panel = function(x, y) {
>   panel.stripplot(x[1], y[1], pch=19, col='skyblue',cex=1.3,xaxt='n')
> panel.stripplot(x[2], y[2], pch=19, col='red',cex=1.3,xaxt='n')
>   panel.stripplot(x[3], y[3], pch=19, col='chocolate',cex=1.3,xaxt='n')
> panel.stripplot(x[4], y[4], pch=19, col='blue',cex=1.3,xaxt='n')
>   panel.stripplot(x[5], y[5], pch=19, col='violet',cex=1.3,xaxt='n')
> panel.stripplot(x[6], y[6], pch=19, col='seagreen',cex=1.3,xaxt='n')
>   panel.stripplot(x[7], y[7], pch=19, col='purple',cex=1.3,xaxt='n')
> panel.stripplot(x[8], y[8], pch=19, col='yellow',cex=1.3,xaxt='n')})
>   print(graf.my.label)
>
> 	[[alternative HTML version deleted]]
>

You need to set the axis.line colour to 0.
Try this:

  colvec <- 1:8
  stripplot(my.factor ~ quantil, my.label,
    xlab="", pch = 19, col = colvec, cex = 1.3,
    scales=list( x = list( draw = FALSE ) ),
    par.settings = list( axis.line = list(col = 0) )
  )

Adjust colvec to your colours.
(All those calls to panel.stripplot seem crazy to me.)

Peter Ehlers



More information about the R-help mailing list