标签与vegan :: ordispider的位置

时间:2013-05-16 08:42:05

标签: r project vegan

我正在使用素食主义者进行DCA排序。我想显示我的分组网站,但是当我使用ordispider时,这些组的标签会互相隐藏。我该如何调整他们的位置?有可能以某种方式使用orditkplot吗?

2 个答案:

答案 0 :(得分:1)

不,orditkplot()无法使用ordispider(),它根本不知道如何处理这样的任意绘图函数。

您没有说明为什么要使用ordispider()在DCA协调中显示您的分组网站?您不需要将它们连接到某些质心或类似物以表示组成员身份。相反,您可以使用绘图符号来区分组,例如

require("vegan")
data(dune)
data(dune.env)

mod <- decorana(dune)

plot(mod, display = "sites", type = "n")

## colour & shape according to Management
col <- c("red","orange","forestgreen","navy")
pch <- 1:4
## add the points
with(dune.env,
     points(mod, display = "sites", col = col[Management],
            pch = pch[Management]))
## add a legend
legend("topright",
       legend = with(dune.env, levels(Management)),
       col = col, pch = pch, title = "Management",
       bty = "n")

或者,我想您可以在没有标签的情况下进行绘图并稍后添加它们,可能使用locator()来识别绘图标签的清晰区域,例如:

plot(mod, display = "sites", type = "p")
with(dune.env, ordispider(mod, groups = Management, col = "red"))
## select 4 locations
coords <- locator(with(dune.env, length(levels(Management))))

## now you have to click on the plot where you want the labels
## automagically finishes after you click the 4th label in this case

## draw labels
text(coords, labels = with(dune.env, levels(Management)))

答案 1 :(得分:0)

您是否尝试过vegan vignette

中的以下内容?
2.1. Cluttered plots
Ordination plots are often congested: there is a large number of sites and species, and it may be impossible to display all clearly. In particular, two or more species may have identical scores and are plotted over each other. Vegan does not have (yet?) automatic tools for clean plotting in these cases, but here some methods you can try:
- Zoom into graph setting axis limits xlim and ylim. You must typically set both, because
vegan will maintain equal aspect ratio of axes.
- Use points and add labell only some points with identify command.
- Use select argument in ordination text and points functions to only show the specied
items.
- Use ordilabel function that uses opaque background to the text: some text labels will
be covered, but the uppermost are readable.
- Use automatic orditorp function that uses text only if this can be done without overwriting
previous labels, but points in other cases.