有沒有人知道,在Rastervis中使用gplot方法時如何去除背景灰色?我已經嘗試刪除主題顏色,但沒有奏效。在Rastervis中使用gplot方法時如何去除背景灰色?
r <- raster(system.file("external/test.grd", package="raster"))
s <- stack(r, r*2)
names(s) <- c('meuse', 'meuse x 2')
library(ggplot2)
theme_set(theme_bw())
gplot(s) + geom_tile(aes(fill = value)) +
facet_wrap(~ variable) +
scale_fill_gradient(low = 'white', high = 'blue') +
coord_equal() +
theme(
plot.background = element_blank()
,panel.grid.major = element_blank()
,panel.grid.minor = element_blank()
,panel.border = element_blank()
,panel.background = element_blank())
看看是否添加theme_bw()的作品 – KFB 2014-10-08 07:09:02
已經設置爲theme_set(theme_bw()),但它不起作用。灰色的顏色似乎來自柵格數據。 – 2014-10-08 07:34:38
你可以嘗試:gplot(s)+ geom_tile(aes(fill = value))+ theme_bw()+ ... – KFB 2014-10-08 07:53:14