【发布时间】:2021-12-03 17:10:42
【问题描述】:
我很难理解为什么legend.horizontal 没有旋转我的图例轴,所以它没有垂直显示?任何帮助将不胜感激。
library(phyloseq)
library(ggplot2)
##phylum level
ps_tmp <- get_top_taxa(physeq_obj = ps.phyl, n = 10, relative = TRUE, discard_other = FALSE, other_label = "Other")
ps_tmp <- name_taxa(ps_tmp, label = "Unkown", species = T, other_label = "Other")
phyl <- fantaxtic_bar(ps_tmp, color_by = "phylum", label_by = "phylum",facet_by = "TREATMENT", other_label = "Other", order_alg = "as.is")
phyl + theme(legend.direction = "horizontal", legend.position = "bottom", )
【问题讨论】:
-
我不知道你正在使用的包,所以无法测试,但不是
legend.direction()类似 '+ guides(fill = guide_legend(nrow = 1, byrow = TRUE) ) +' 可能会起作用