1

Any ideas about how to change the color, line width and other Graphical parameters in Panel Function for xyplot? I was trying use col and panel.col, did not work.

library(lattice)
xyplot(F(X) ~ X, 
   panel = function(x, y) {
   panel.xyplot(x, y)
   panel.abline(lm(y ~ x))
   }, 
   xlab = "x (%)", 
   ylab = "y (%)")
Random Cotija
  • 613
  • 1
  • 10
  • 26
Nan
  • 271
  • 1
  • 7
  • When asking for help, you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. What colors are you trying to change here in particular? It would be nice to provide data so we can actually run and test the code. – MrFlick Jul 02 '18 at 15:45
  • Please be specific: where does `xyplot` come from? `lattice`? – camille Jul 02 '18 at 15:53
  • @camille Yes, thanks. – Nan Jul 02 '18 at 16:02
  • 1
    there are several ways to do this in lattice but perhaps it is enough to do ...`panel.xyplot(x, y, pch=16, col="red") ; panel.abline(lm(y ~ x), lwd=3, col="blue")` etc – user20650 Jul 02 '18 at 20:01

0 Answers0