【发布时间】:2015-03-08 15:43:26
【问题描述】:
我有想要在 3 维中绘制的数据。我有两个数据框,我希望将它们的数据绘制在同一张图中(所有变量的比例都相似,只有一个数据框具有所有异常值,我希望看到与大多数的分离)。我附上了数据样本。两个数据框具有相同的列。
id ele hap.700. hap.400. HL HW IN IOA
1 F031 1745 B2 BMP1 0.2701648 0.2831743 0.13052906 0.1860364
2 F032 1740 B2 BMP1 0.2903226 0.2985939 0.06823821 0.1546733
3 F084 2000 B3 BMP1 0.2379221 0.3864935 0.09090909 0.1802597
4 F189 2150 B3 BMP1 0.3370195 0.3712480 0.10110584 0.1827278
5 F200 2355 B3 BMP1 0.2813953 0.4000000 0.10872093 0.1680233
6 F085 2020 B4 BMP2 0.2659981 0.3595989 0.11652340 0.1757402
我在 2D 绘图中使用了以下代码
x=data.frame(read.csv(file.choose())) #Choose the first data.frame
plot(x$HL,x$HW,pch=19,col=as.factor(x$hap.700.)) #Plots the majority data
library(calibrate)
y=data.frame(read.csv(file.choose())) #Choose the second data.frame
textxy(y$HL,y$HW,y$hap.700.) #adds labels of the outgroups on the same plot
但是,如果我尝试在 rgl 包中使用 textxy 函数,我将无法这样做。是否有任何等效的 3D 绘图包可以用来实现我想要做的事情?
【问题讨论】: