Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 在地层图外添加注释_R_Plot_Lattice - Fatal编程技术网

R 在地层图外添加注释

R 在地层图外添加注释,r,plot,lattice,R,Plot,Lattice,如何向地层图添加注释 例如,下面是模拟的分层图: library(analogue) data(V12.122) Depths <- as.numeric(rownames(V12.122)) names(V12.122) (plt <- Stratiplot(Depths ~ O.univ + G.ruber + G.tenel + G.pacR, data = V12.122, type = c("

如何向地层图添加注释

例如,下面是模拟的分层图:

library(analogue)
data(V12.122)
Depths <- as.numeric(rownames(V12.122))
names(V12.122)

(plt <- Stratiplot(Depths ~ O.univ + G.ruber + G.tenel + G.pacR,
                   data = V12.122,  
                   type = c("h","l","g"),
                   zones = 400))

plt
库(模拟)
数据(V12.122)
深度这里有一种方法:

pacman::p_load(analogue)
data(V12.122)
Depths <- as.numeric(rownames(V12.122))
names(V12.122)

(plt <- Stratiplot(Depths ~ O.univ + G.ruber + G.tenel + G.pacR,
                   data = V12.122,  
                   type = c("h","l","g"),
                   zones = 400))

(plt2 <- Stratiplot(Depths ~ O.univ + G.ruber + G.tenel + G.pacR,
                   data = V12.122,  
                   type = c("h","l","g"),
                   yticks = c(150,600,1000)
                   ))

我检查了这个函数的源代码,发现它是
xyplot
的包装,然后我进行了搜索,发现
doubleYScale
可以通过这种方式将第二个Y轴添加到
xyscale

或者保持颜色一致为黑色

doubleYScale(plt,plt2,add.axis=T,use.style = F)

非常整洁,谢谢!我要添加<代码>更新(tRel.Sist.Objutter),PAR.Stase= SimeLead(COL= C(“黑色”,“黑色”))< /C> >使颜色更加均匀…
require(latticeExtra)
doubleYScale(plt,plt2,add.axis=T)
doubleYScale(plt,plt2,add.axis=T,use.style = F)