首页 > 解决方案 > 将图例添加到 ordirgl {vegan3d}

问题描述

我正在尝试将图例添加到使用 vegan3d 包生成的ordirgl()图形。我已经成功地使用plot3d()legend3d()包中做到了这一点。中提供的一些功能,因为我正在处理排序,如果我能够制作传奇,我更愿意使用它。

使用包:

data("dune.env")
data("dune")
sol <- metaMDS(dune, k = 3)

par3d(windowRect = c(100, 100, 612, 612))
with(sol, plot3d(points[,1], points[,2], points[,3], type = "s", col = rainbow(3)[as.numeric(dune.env$Use)]))
legend3d("topright", legend = unique(dune.env$Use), pch = 16, col = rainbow(3), inset = c(0.03))

是否可以为此添加图例?

ordirgl(sol, size = 4, col = rainbow(3)[as.numeric(dune.env$Use)])
orglspider(sol, dune.env$Use, col = rainbow(3), scaling = "sites")
orglellipse(sol, dune.env$Use, col = rainbow(3), kind = "se", conf = .95, scaling = "sites")

谢谢您的帮助!

标签: rlegendrglvegan

解决方案


推荐阅读