0

我试图在一个图中绘制两个半变异函数,但不幸的是它不起作用。我想解决方案很简单,但我的拉丁文已经结束了。

这是我想放在一个图中的变异函数的代码:

variog_iso_a1 <- fit.variogram(  emp_variog_iso_a1,
                                         vgm(  psill = 2000,
                                               model = "Sph",
                                               range = 200,
                                               nugget = 500))
        
        plot(emp_variog_iso_a1, variog_iso_a1, as.table=TRUE, main = "Acker H1 C_org", plot.numbers=T)


variog_iso_a2 <- fit.variogram(  emp_variog_iso_a2,
                                         vgm(  psill = 2000,
                                               model = "Sph",
                                               range = 200,
                                               nugget = 500))
        
        plot(emp_variog_iso_a2, variog_iso_a2, as.table=TRUE, main = "Acker H2 C_org", plot.numbers=T)

其次,我还想在一个图中绘制两个半变异函数,但由于值不同,右侧有第二个 y 轴。

variog_iso_a1 <- fit.variogram(  emp_variog_iso_a1,
                                         vgm(  psill = 2000,
                                               model = "Sph",
                                               range = 200,
                                               nugget = 500))
        
        plot(emp_variog_iso_a1, variog_iso_a1, as.table=TRUE, main = "Acker H1 C_org", plot.numbers=T)


variog_iso_l1 <- fit.variogram(  emp_variog_iso_l1,
                                         vgm(  psill = 2000,
                                               model = "Sph",
                                               range = 200,
                                               nugget = 500))
        
        plot(emp_variog_iso_l1, variog_iso_l1, as.table=TRUE, main = "Acker H1 Lichtwert", plot.numbers=T)

我只能显示每个变异函数的两个点,但不能在里面安装模型。这是我试过但不起作用的代码!

plot(emp_variog_iso_a1$dist, emp_variog_iso_a1$gamma, ylim=c(0,2500))
        points(emp_variog_iso_a2$dist, emp_variog_iso_a2$gamma, col = "red", add=T, labels=emp_variog_iso_a2$np)
        
        
        plot(emp_variog_iso_a1$dist, emp_variog_iso_a1$gamma, ylim=c(0,2500),main="Semivarianz Lichtwert und organische Substanz Horizont 1 Ackerland", ylab = "Semivarianz", xlab = "Distanz" )
        par(new = TRUE)
        plot(emp_variog_iso_l1$dist, emp_variog_iso_l1$gamma, col = "red", labels=emp_variog_iso_l1$np )
        
        points(emp_variog_iso_l1$dist, emp_variog_iso_l1$gamma, col = "red", add=T, labels=emp_variog_iso_l1$np, yaxt = "n")
        
        plot(emp_variog_iso_a2$dist, emp_variog_iso_a2$gamma, ylim=c(0,2500),main="Semivarianz Lichtwert und organische Substanz Horizont 2 Ackerland", ylab = "Semivarianz", xlab = "Distanz" )
        points(emp_variog_iso_l2$dist, emp_variog_iso_l2$gamma, col = "red", add=T, labels=emp_variog_iso_l2$np)
    

谢谢你的帮助!!!

4

1 回答 1

0

您可以variogramLine()为此使用:

VL=variogramLine(YourVariogramFit, maxdist = ...)

接下来,将其添加到您的情节中lines()

lines(VL)
于 2021-06-23T11:10:46.270 回答