I am using the function densityplot() and grid.arrange(), this is the example:
library(rasterVis)
library(gridExtra)
library(raster)
f <- system.file("external/test.grd", package="raster")
r <- raster(f)
data<-stack(r,r*2,r/3,r+100,r,r*2,r*2,r/3,r+100,r,r-10,r)
names(data) <- month.abb
a<- densityplot(data[[1:3]],main="title 1")
b<- densityplot(data[[4:6]],main="title 2")
c<- densityplot(data[[7:9]],main="title 3")
d<- densityplot(data[[10:12]],main="title 4")
grid.arrange(a,b,c,d,ncol=2,top="main title ")
Using this code my output is:
No show "title 1", "title 2" .... and the output using with my data is:
equal does not display the main title of the densityplot and the label ("Jan" "Feb" "Mar" "Apr" ....)
It is possible that can guide me please.
thank you!!