How to visualize 3 factors using geom_point?

How to visualize 3 factors using geom_point?



I have 3 factors that I would like to represent on an NMDS plot.



my first attempt is this:
However, I would like the circles (or triangles) to be filled, or empty based on if they are Fungi or NF)


ggplot(data=NMDS2_plsMet,aes(x,y,colour=Location))+
geom_point(aes(shape=Insect,fill=Fungi))+theme_bw()



enter image description here



So then I tried this:


ggplot(data=NMDS2_plsMet,aes(x,y,colour=Location))+
geom_point(aes(shape=Insect,fill=Fungi))+
scale_shape_manual(values=shape_values)+theme_bw()



Any suggestions for how I can have filled/empty circles and triangles.



enter image description here






some of the shapes (21-25 I think) take a fill as well as a colour.

– Richard Telford
May 11 '18 at 20:08






You might need to use both scale_fill_manual and scale_size_manual (scale_size_manual will need both Insect and Fungi, and may be needed to select shapes that are hollow). For scale_fill_manual, try something akin to +scale_fill_manual(name = "Type", labels = c("Fungi", "NF"), values = c()) sthda.com/english/wiki/…

– A Duv
May 11 '18 at 21:20


scale_fill_manual


scale_size_manual


scale_fill_manual


+scale_fill_manual(name = "Type", labels = c("Fungi", "NF"), values = c())






thanks this helped

– user2814482
May 24 '18 at 16:08




0



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy