R: how to change lattice (levelplot) color theme?

前端 未结 5 1053
陌清茗
陌清茗 2021-01-31 20:30

The default theme on my installation is something which maps the values to pink and cyan. How to change it for example to a gray scale theme?

5条回答
  •  春和景丽
    2021-01-31 21:15

    You can use

    library(lattice)
    lattice.options(default.theme = standard.theme(color = FALSE))
    

    which turns on black-and-white suitable for printing. I've also played with things like

    sb <- trellis.par.get("strip.background") 
    sb[["col"]][1] <- "lightgray"
    trellis.par.set("strip.background", sb) 
    

    which changes just the header background.

    And I thought people only asked ggplot2 questions here :) Nice to see some lattice for a change.

提交回复
热议问题