Labelling samples in ord_plot PCoA #156
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi, do you mean label each individual point, or each colour/shape group? If individual points, you should be able to add geom_text, or (maybe better geom_text_repel from ggrepel package) to the plot. This will be pretty crowded though, so you might also want to filter the points you label, e.g. by setting the data argument to a filtering function in the geom to e.g. geom_text(data = function(df) filter(df, variable == "value"), mapping = aes(...)) |
Beta Was this translation helpful? Give feedback.
-
Hi David thanks |
Beta Was this translation helpful? Give feedback.
Hi, do you mean label each individual point, or each colour/shape group?
If individual points, you should be able to add geom_text, or (maybe better geom_text_repel from ggrepel package) to the plot.
set the label aesthetic e.g. geom_text_repel(aes(label = NAMEOFVARIABLEYOUWANTTOLABELWITH))
This will be pretty crowded though, so you might also want to filter the points you label, e.g. by setting the data argument to a filtering function in the geom to e.g. geom_text(data = function(df) filter(df, variable == "value"), mapping = aes(...))