rggplot2phyloseq

Change size of label annotations in a ggplot


I am trying to change text label sizes inside my plot (not the axes, rather the label annotations)

I am working with a phyloseq object but I don't think that matters. Here is the code and the output. Any suggestions?

plot_ordination(prokaryote_ra, ordBC, color = "Stage", label="SampleID") +  ggtitle("PCoA: Bray-Curtis")

graph of ordination plot with label annotations that are too small

enter image description here


Solution

  • Looks like size for the text label is a fixed value 2, in the plot_ordination() function see L1135 at GitHub in plot-methods.R file

    ...
    p = p + geom_text(label_map, data=rm.na.phyloseq(DF, label),
                          size=2, vjust=1.5, na.rm=TRUE) # <--- here size is set to 2
    ...
    

    Solution would be either submit an issue at GitHub, and wait for an update from maintainer, or copy paste the function locally, and change the size to match your needs.