I would like to delete a legend in PCA in R
1
0
Entering edit mode
5.1 years ago

I used script below to draw a PCA. In order to increase the points, I added size=0 in geom_point(). But in the figure, there is a legend size. How can I remove the legend? Thanks.

ggplot(degree121, aes(PC1, PC2, col=Classification, fill=Classification, group=Classification))+ stat_ellipse(geom="polygon", alpha=0.1) + geom_point(aes(shape=Classification, color=Classification, size=0))+ theme_bw()+ scale_color_manual(values = c("red","green","blue"))

R • 1.8k views
ADD COMMENT
1
Entering edit mode
5.1 years ago

Add + theme(legend.position = "none").

Questions for common packages like ggplot can almost always be answered via Google rather than posting here.

ADD COMMENT

Login before adding your answer.

Traffic: 1999 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6