oscarperpinan / rastervis

The raster package defines classes and methods for spatial raster data access and manipulation. The rasterVis package complements raster providing a set of methods for enhanced visualization and interaction.
oscarperpinan.github.io/rastervis
GNU General Public License v3.0
85 stars 26 forks source link

can't get rid of grey peaks around continuous levelplot #88

Closed cperk closed 2 years ago

cperk commented 2 years ago

How do I suppress these? They make it very difficult to fit several levelplots in a multi-panel plot.

oscarperpinan commented 2 years ago

Please, post a reproducible example.

cperk commented 2 years ago

Sure! Using your example from this tutorial:

https://oscarperpinan.github.io/rastervis/

library(raster)
library(rasterVis)
##Solar irradiation data from CMSAF 
old <- setwd(tempdir())
download.file('https://raw.github.com/oscarperpinan/spacetime-vis/master/data/SISmm2008_CMSAF.zip',
              'SISmm2008_CMSAF.zip', method='wget')
unzip('SISmm2008_CMSAF.zip')

listFich <- dir(pattern='\\.nc')
stackSIS <- stack(listFich)
stackSIS <- stackSIS * 24 ##from irradiance (W/m2) to irradiation Wh/m2

idx <- seq(as.Date('2008-01-15'), as.Date('2008-12-15'), 'month')

SISmm <- setZ(stackSIS, idx)
names(SISmm) <- month.abb

setwd(old)

levelplot(SISmm, layers = 1, margin = list(FUN = 'median'), contour=TRUE)

I want to suppress the gray "peaks" surrounding the plot:

Screen Shot 2022-06-02 at 7 00 00 PM

oscarperpinan commented 2 years ago

Use margin = FALSE