I would like to create a scatter plot were each point is graphed as a number instead of a circle. I need a legend that maps the number label in the scatter plot to the sample name.
My current attempt uses this code:
plot<-ggplot(df_mds,aes(x=x,y=y,group=interaction(Group,Sample)))+geom_text(aes(label=Label,color=Group,group=Sample),show.legend =T)
plot<-plot+guide()
plot<-plot+labs(x="Leading logFC dimension 1", y="Leading logFC dimension 2")
Using this data:
And creates this graph:
The graph above is almost exactly what I want except I need a legend mapping the values in the "Label" column to the values in the "Sample" column.
I have seen this post but I don't know how to combine the different shapes to create new numbers.
Any help would be greatly appreciated.
dput
) along with your question. – Jonathan V. Solórzano