[R-sig-Geo] Fill levelplot with pattern instead of color

Thiago V. dos Santos thi_veloso at yahoo.com.br
Wed Oct 1 00:16:50 CEST 2014


Dear all,
I am using level plots from the R rasterVis package to plot land use classes as categorical data. The example from the function help can be used to create some categorical data:
r <- raster(nrow=10, ncol=10)
r[] = 1
r[51:100] = 3
r[3:6, 1:5] = 5
r <- ratify(r)
rat <- levels(r)[[1]]

rat$landcover <- c('Pine', 'Oak', 'Meadow')
rat$class <- c('A1', 'B2', 'C3')
levels(r) <- rat
levelplot(r, col.regions=c('white', 'grey', 'black'))

My problem is that the classes in my dataset are more subtle, and therefore grey levels do not properly show some of them (it lacks contrast). As an alternative, I wonder if there is some way to fill a specific class (in the example above, let's say 'Meadow') with patterns (say, hatched) instead of colors.

A good example of what I mean by pattern is this map: http://www.ucl.ac.uk/~ucfbpve/papers/VermeeschIGR2003/chinazones2.jpg
Thanks in advance for any direction. 
Greetings,
--
Thiago V. dos Santos
PhD student
Land and Atmospheric Science
University of Minnesota
http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm
Phone: (612) 323 9898
	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list