如何手动调整地层图中每个面板的 x 轴限制?
例如,这里是 Stratiplot
来自 analogue
:
library(analogue)
data(V12.122)
Depths <- as.numeric(rownames(V12.122))
(plt <- Stratiplot(Depths ~ O.univ + G.ruber + G.tenel + G.pacR,
data = V12.122, type = c("h","l","g","smooth")))
例如,我如何将 G.ruber 的 xlim 更改为 c(0.3, 0.9) 并将 G.pacR 更改为 c(0, 0.75)?
或者,另一种可能性,这里是
strat.plot
来自 rioja
:library(rioja)
library(vegan) ## decorana
data(RLGH)
# remove less abundant taxa
mx <- apply(RLGH$spec, 2, max)
spec <- RLGH$spec[, mx > 3]
depth <- RLGH$depths$Depth
#basic stratigraphic plot
strat.plot(spec, y.rev=TRUE)
例如,我如何将 TA004A 的 xlim 更改为 c(0, 20)?
我想我需要提供一些东西来解决底层的格子/基图代码,但我不确定如何开始。
最佳答案
这是通过调整绘图对象的限制并使用格子额外包来调整面板大小的快速部分答案
# your data
library(analogue)
data(V12.122)
Depths <- as.numeric(rownames(V12.122))
(plt <- Stratiplot(Depths ~ O.univ + G.ruber + G.tenel + G.pacR,
data = V12.122, type = c("h","l","g","smooth")))
# manually change the limits of second panel
# this auto updates ticks and labels
plt$x.limits[[2]] <- c(0.25,0.95) ;
# resize the panels
latticeExtra::resizePanels(plt, w=c(5,5,5,5))
这使
然而,这不包括每个段开头的小空格
关于r - 更改地层图(即多面板图)上的 x 轴限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34645201/