[R-sig-Geo] directional semivariograms on the same graph

Edzer J. Pebesma e.pebesma at geo.uu.nl
Tue Oct 9 10:36:20 CEST 2007


Mauricio, it's easier than you think; try

Zn.vgm1 <- variogram(Zn~1, jura.pred.xy, alpha=c(22.5, 67.5), cutoff=2,  
boundaries=c(0.1, 0.2*(1:10)), tol.hor=22.5)

plot(Zn.vgm1) # with 2 panels
plot(Zn.vgm1, multipanel=FALSE) # in a single panel

the add=TRUE does not work as the plot methods for gstat variograms uses 
xyplot in lattice. You can of course change the variogram into a 
data.frame and then use base plot methods.
--
Edzer

Mauricio Zambrano wrote:
> R.2.5.1 and gstat 0.9-39.
> --------------------------------
>
> Hi,
>
> Does anybody knows how to plot two or more semivariogams on the same
> graph ?, I mean, only one x axis and only one Y axis and between them,
>  2 or more directional semivariograms ?.
>
> I defined:
>
> jura.pred.xy <- jura.pred
> names(jura.pred.xy)[1:2] <- c("x", "y")
> coordinates(jura.pred.xy) <- ~x+y
>
> and after I tried with:
>
> Zn.vgm <- variogram(Zn~1, jura.pred.xy, alpha=c(22.5, 67.5, 112.5,
> 157.5), cutoff=2,  boundaries=c(0.1, 0.2*(1:10)), tol.hor=22.5)
> plot(Zn.vgm, type="b", as.table=TRUE, main='Zn data', panel=panel.superpose)
>
> but I got:
> plot(Zn.vgm, type="b", as.table=TRUE, main='Zn data', panel=panel.superpose)
>
> After I tried with:
>
> Zn.vgm1 <- variogram(Zn~1, jura.pred.xy, alpha=c(22.5), cutoff=2,
> boundaries=c(0.1, 0.2*(1:10)), tol.hor=22.5)
> Zn.vgm2 <- variogram(Zn~1, jura.pred.xy, alpha=c(67.5), cutoff=2,
> boundaries=c(0.1, 0.2*(1:10)), tol.hor=22.5)
>
> plot(Zn.vgm1, type="b", as.table=TRUE, main='Zn data, Alpha=22.5º')
> plot(Zn.vgm2, type="b", as.table=TRUE, main='Zn data, Alpha=67.5º', add=TRUE)
>
> but only remains the second graph.
>
> Thanks in advance
>
> Mauricio
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>




More information about the R-sig-Geo mailing list