I have a lattice plot, I am trying to change its background but can't seem to make it work. I am also trying to add Custom heatmap labels (ranging from 1 to 5, and would like to add some text. )
par(bg = "yellow")
levelplot(as.matrix(x = c(1:5),y = c(5:1))
)
Thank you for your time!
Like
ggplot
,lattice
is based on grid graphics, not base R graphics, so setting thepar
won't have any effect. You can change the lattice pars, or alternatively you can do it after the fact usinggrid.edit
:Needless to say, if you are looking for multiple formatting changes, easy annotations, custom scales and rich documentation, you should switch to ggplot: