Hashed theme on a Raster plot

50 Views Asked by At

I have a composite raster plot created by the script in R:

p0<-levelplot(laggueED, margin=FALSE, at=breaks, col.regions = myCol)+
  latticeExtra::layer(sp.polygons(polymed))+
  latticeExtra::layer(sp.points(pts[[panel.number()]], pch = 8, col="red", cex=1))

It represents a gradient of climatic conditions for one species across several decades and the red stars are the occurrences. Conditions out of the range 0-1 are not suitable. I was asked to improve the representation by adding lines on top of the existing colour scale to highlight these areas of not suitability.

My idea is to create another raster layer - p1 - with only the pixels out of the 0-1 range and then sum p0+p1 to overlay them.

The problem is that I cannot find how to generate an hashed theme for a raster plot.

I would appreciate any tip!

Many thanks Manuelaenter image description here

1

There are 1 best solutions below

0
On

Here is a solution for generating patterns for lattice-plots. Since recently, there's also a relevant extension {ggpattern} to ggplot.