0

我在 R 中有一个绘图和 NMDS 图,但我无法更改点的颜色,并且我有 4 个不同的品种。我尝试了 2 个不同的命令,但它仍然不起作用。我希望任何人都可以帮助我。我对 R 很陌生。

命令 1:

JHdatascore$Ch.megacephala = pc$Cm
JHdatascore$Ch.rufifacies = pc$cr
JHdatascore$M.domestica = pc$md
JHdatascore$Hours = pc$Hours
head(JHdatascore)
xx=ggplot2(JHdatascore, aes(x = NMDS1, y = NMDS2))+geom_point(size = 4, aes( shape = Ch.megacephala","Ch.rufifacies","M.domestica", colour =Hours))+theme(axis.text.y = element_text(colour = "black", size = 12, face = "bold"),axis.text.x = element_text(colour = "red","yellow","blue", face = "bold", size = 12),legend.text = element_text(size = 12, face 
="bold", colour ="red","yellow","blue"),legend.position = "right", axis.title.y = element_text(face = "bold", size = 14),axis.title.x = element_text(face = "bold", size = 14, 
colour = "black"),legend.title = element_text(size = 14, colour = "black", face = "bold"),panel.background = element_blank(), panel.border = element_rect(colour = "black",fill = NA, size = 1.2),legend.key=element_blank()) + labs(x = "NMDS1", colour = "Hours", y ="NMDS2", shape = "Ch.megacephala","Ch.rufifacies","M.domestica")+ scale_colour_manual(values = c("#009E73", "#E69F00"))
xx
flies*

命令 2:

points(JH,disp="species",pch=21,col="red",bg="orange",cex=1.3)

在此先感谢您的帮助。

4

0 回答 0