joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
582 stars 187 forks source link

How to insert axis label in beta diversity #1210

Closed bioinfonext closed 5 years ago

bioinfonext commented 5 years ago

Hi,

could you please suggest me, how can insert axis label as PC1 and PC2 with percent of variance in the below code.

Now It is showing label as Axis1 (20%), Axis2(13%), I want PC1 and PC2 instead of axis.

phyloseq_prop = transform_sample_counts(ps5, function(x) 1E6 * x/sum(x))

phyloseq_prop_bray <- ordinate(phyloseq_prop, "PCoA", "bray") p=plot_ordination(phyloseq_prop,phyloseq_prop_bray, color = "Treatment", shape="Villages") p = p + geom_point(size = 4, alpha = 0.75) p + ggtitle("PCoA 16S data, Bray distance")

Thanks

evertonjlima commented 5 years ago

You can make use of the labs function of ggplot2.

p + ggtitle("PCoA 16S data, Bray distance") + labs(x='PC1 [%?]', y='PC2 [%?]')
bioinfonext commented 5 years ago

You can make use of the labs function of ggplot2.

p + ggtitle("PCoA 16S data, Bray distance") + labs(x='PC1 [%?]', y='PC2 [%?]')