老板要用R做个multidimensonal scaling的plot图,四个主要人种,三个非主流人类化石
- par(mar=c(5,4,8,10)+0.1,xpd=TRUE)
- plot(m$C1,m$C2,pch=16,col=k,main="MDS",xlab="Dim1",ylab="Dim2")
- legend("bottomright",inset=c(-0.45,0),c("Denisovan","Neandertal","Papuan","YRI","CEU","JPT","CHB"),pch=16,col=c("orange","green","blue","black","pink","red","yellow"))
par、plot、legend的命令应该依次使用
par中的mar是单位为文本行的边界,c(5,4,8,10)依次是:底,左,上,右(+0.1不知道什么意思),xpd意思是能在图以外的地方画legend
plot中xlab是横轴标注,k是c(rep("black",90)),意思是用黑色标注90个人
legend中bottomright是右下角,inset是配套bottomright的坐标,后面紧跟是标注等
阅读(20171) | 评论(0) | 转发(0) |