Arnaud,

With raster objects you can do

plot(x, fun=log)

But in the current version the legend is not affected, and hence wrong --
fixed in the release.

Robert

On Thu, Oct 6, 2011 at 1:54 AM, Paul Hiemstra <paul.hiemstra@knmi.nl> wrote:

> Hi,
>
> You could use ggplot:
>
> library(gstat)
> library(ggplot2)
> loadMeuse()
>
> meuse.grid.df = as.data.frame(meuse.grid)
> head(meuse.grid.df)
>
> # Create a dist + 1 for log transformation
> # prevents -Inf for 0 values
> meuse.grid.df$dist_plus1 = meuse.grid.df$dist + 1
>
> ggplot(aes(x = x, y = y, fill = dist_plus1), data = meuse.grid.df) +
> geom_tile() +
>    coord_equal() + scale_fill_continuous(trans="log")
>
> # Some theme changes I like
> theme_set(theme_bw())
> ggplot(aes(x = x, y = y, fill = dist_plus1), data = meuse.grid.df) +
> geom_tile() +
>    coord_equal() + scale_fill_continuous(trans="log")
>
> hope this helps,
> Paul
>
> On 10/05/2011 06:21 PM, Arnaud Mosnier wrote:
> > Dear Geo Users,
> >
> > Please, can someone explain me how to plot a raster using a logarithmic
> > scale and obtaining the legend with this scale ?
> >
> > Thanks for any help,
> >
> > Arnaud
> >
> >       [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
> --
> Paul Hiemstra, Ph.D.
> Global Climate Division
> Royal Netherlands Meteorological Institute (KNMI)
> Wilhelminalaan 10 | 3732 GK | De Bilt | Kamer B 3.39
> P.O. Box 201 | 3730 AE | De Bilt
> tel: +31 30 2206 494
>
> http://intamap.geo.uu.nl/~paul
> http://nl.linkedin.com/pub/paul-hiemstra/20/30b/770
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

