0

I'm trying to change the default line colours in xyplot. One way to do this would be possibly by changing the default colours with trellis.par.set(). Would be there however other easier solution to this as changing the default colours?

This is my graph:

 xyplot(m1+m2+m3~TimeAxis, type=c("p","spline"), xlab="Time", main= "",   
        ylim=c(0.08,0.36), scales=list(y=list(at=seq(0.08,0.36,0.02))),
        ylab="", auto.key = list(space = "right"), lwd=2)

enter image description here

now to change the colour lines I would just insert into xyplot for instance:

col.line = c('brawn', 'blue', 'gray') 

however the referencing on the right doesn't change with the col.line new colours just set.

Maximilian
  • 4,177
  • 7
  • 46
  • 85

1 Answers1

2

In meantime found solution. Just in case someone would look for quick fix:

One possible solution to this with trellis.par.set:

newSet <- col.whitebg() 
newSet$superpose.symbol$col <- c("blue3","orange2","gray1")
newSet$superpose.symbol$pch <- 1
newSet$superpose.symbol$cex <- 1
newSet$superpose.line$col <- c("blue3","orange2","gray1")
trellis.par.set(newSet)

Now colours can be easily set as you wish.

enter image description here

Maximilian
  • 4,177
  • 7
  • 46
  • 85