[prev in list] [next in list] [prev in thread] [next in thread]
List: r-sig-geo
Subject: Re: [R-sig-Geo] plot.gstatVariogram - overlay multiple models on
From: Edzer Pebesma <edzer.pebesma () uni-muenster ! de>
Date: 2008-12-18 7:03:32
Message-ID: 4949F5C4.8060705 () uni-muenster ! de
[Download RAW message or body]
Try:
mypanel = function(x,y,...) {
vgm.panel.xyplot(x,y,...)
panel.lines(variogramLine(vgm2,1500))
}
require(gstat)
g = gstat(formula = log(zinc)~1, data = meuse)
v = variogram(log(zinc)~1,meuse)
vgm1 = fit.variogram(v,vgm(1, "Sph", 900,1))
vgm2 = fit.variogram(v,vgm(1, "Exp", 300,1))
print(plot(v, model=vgm1 ,panel=mypanel))
--
Edzer
Timothy W. Hilton wrote:
> Hello,
>
> Using gstat, I would like to overlay several different variogram
> models onto a single empirical semivariogram. I am having trouble
> mastering the necessary lattice plotting commands. Using an example
> from this list (or maybe the docs for gstat; I'm not sure):
>
> mypanel = function(x,y,...) {
> vgm.panel.xyplot(x,y,...)
> }
>
> require(gstat)
> g = gstat(formula = log(zinc)~1, data = meuse)
> v = variogram(log(zinc)~1,meuse)
> vgm1 = fit.variogram(v,vgm(1, "Sph", 900,1))
> vgm2 = fit.variogram(v,vgm(1, "Exp", 300,1))
> print(plot(v, model=vgm1 ,panel=mypanel))
>
>
> This plots the variogram with vgm1. I would now like to overlay vgm2,
> in a different color. I have tried many variations on making model a
> list, or trying to write a panel function that will plot the
> variogram, then both models sequentially, but I can't get anything to
> work.
>
> Many thanks for any help,
> Tim
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de/
http://www.springer.com/978-0-387-78170-9 e.pebesma@wwu.de
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic