[GRASS-stats] Superimpose density plots in R

Dylan Beaudette debeaudette at ucdavis.edu
Wed Jan 28 15:19:40 EST 2009


On Wednesday 28 January 2009, Nikos Alexandris wrote:
> On Wed, 2009-01-28 at 12:03 +0100, Jasiewicz Jarosław wrote:
> > Nikos Alexandris pisze:
> > > I've a couple or raster maps (MODIS bands) in R and what I am trying to
> > > achieve is to get density plots superimposed in one graph (for the sake
> > > of easy visual comparison).
> > > Any pointers for this "comparison" task?
> >
> > Hi
> > simply use density function with the same bandwith=, from=, to= for each
> > raster and next use lines to add curves for vuisual comparing
> >
> > for example:
> > plot(density(bronze$a_slope,bw=0.1,from=0, to=12), col=2)
> > lines(density(neolitic$a_slope,bw=0.1,from=0, to=12), col=1)
> >
> > Jarek
>
> Thanks, of course it works :-). It is soooo easy :D
> Cheers, Nikos
>
> _______________________________________________
> grass-stats mailing list
> grass-stats at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-stats


library(lattice)
densityplot(~ value | group)

-- 
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341


More information about the grass-stats mailing list