[R-sig-Geo] colors (and other issues) in rasterVis()
Agustin Lobo
alobolistas at gmail.com
Fri May 3 20:09:18 CEST 2013
Thanks Oscar, almost there.
But cannot find the way of customizing the distribution of the grid,
i.e., a 4 rows x 2 cols plot.
A (minor) problem in the man page is that the links to i.e. levelplot
are circular, they point to
rasterVis::levelplot and I understand they should point to
lattice::levelplot. A major problem
is that once in the appropriate page I still cannot find what I'm looking for.
Expanding the doc in the rasterVis page for levelplot would be great,
but I understand this is
not easy (and not fun). Perhaps adding this case to the current
examples in the page could be a working solution.
Agus
On Fri, May 3, 2013 at 3:59 PM, Oscar Perpiñán Lamigueiro
<oscar.perpinan at gmail.com> wrote:
> Hello,
>
> 1.- Use names.attr to define the labels of each panel if they are
> different from the layers names.
>
> 2.- The axes can be customized with scales. To suppress them completely
> use scales=list(draw=FALSE).
>
> 3.- The colors are defined with col.regions (you were using col.region)
> or par.settings. There are some examples with par.settings and
> predefined themes here: http://rastervis.r-forge.r-project.org/#themes.
> I will improve the documentation to clarify this point.
>
> This code should work for your three requirements:
>
> r <- raster(nrow=10, ncol=10)
> r[] <- runif(100)
> s <- stack(lapply(1:8, function(i)r))
>
> levelplot(s, scales=list(draw=FALSE), colorkey=FALSE,
> col.regions=gray.colors(128,gamma=0.5),
> names.attr=paste0('MNF-', 1:8))
>
> myTheme <- rasterTheme(region=gray.colors(128,gamma=0.5))
> levelplot(s, scales=list(draw=FALSE), colorkey=FALSE,
> par.settings=myTheme,
> names.attr=paste0('MNF-', 1:8))
>
> levelplot(s, scales=list(draw=FALSE), colorkey=FALSE,
> par.settings=GrTheme(),
> names.attr=paste0('MNF-', 1:8))
>
> Best,
>
> Oscar.
> Agustin Lobo <alobolistas at gmail.com> writes:
>
>> Hi!
>> I do not get to plot a set of 8 raster layers from a brick the way I
>> want with rasterVis()
>> I do:
>> require(rasterVis)
>> levelplot(adlsEMNFVIS[[1:8]],axes=FALSE,colorkey=FALSE,col.region=gray.colors(128,gamma=0.5))
>>
>> I want to:
>> 1. Do not plot the names of the layers or plot a different text. i.e.
>> paste("MNF-",1:8,sep="")
>> 2. Do not plot the axes or at least the axes text (the numbers).
>> 3. Use a grey scale.
>>
>> I've gone through the man page and I think that I should use
>> par.settings=, but the help page
>> links to another page and that one to another... and finally get lost.
>>
>> Any help appreciated!
>>
>> Thanks
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
> --
> Oscar Perpiñán Lamigueiro
> Grupo de Sistemas Fotovoltaicos (IES-UPM)
> Dpto. Ingeniería Eléctrica (EUITI-UPM)
> URL: http://procomun.wordpress.com
> Twitter: @oscarperpinan
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
More information about the R-sig-Geo
mailing list