从R中的条形图中删除线

从R中的条形图中删除线,r,qiime,R,Qiime,我使用RStudio为宏基因组数据创建了一个条形图 plot_bar(mp3, "Sampletype", fill = "Family", title = title) 但我在酒吧里看到了线。我需要没有线的透明酒吧。怎么做 图书馆(“phyloseq”);包装版本(“phyloseq”) 图书馆(“格式”);包装版本(“格式”) 图书馆(“ggplot2”);包装版本(“ggplot2”) 图书馆(“phyloseq”);包装版本(“phyloseq”) 图书馆(“格式”);包装版本(“格

我使用RStudio为宏基因组数据创建了一个条形图

plot_bar(mp3, "Sampletype", fill = "Family", title = title)
但我在酒吧里看到了线。我需要没有线的透明酒吧。怎么做

图书馆(“phyloseq”);包装版本(“phyloseq”)

图书馆(“格式”);包装版本(“格式”)

图书馆(“ggplot2”);包装版本(“ggplot2”)

图书馆(“phyloseq”);包装版本(“phyloseq”)

图书馆(“格式”);包装版本(“格式”)

图书馆(“ggplot2”);包装版本(“ggplot2”)

biom1=biomformat::read_biom(biom_file=“otu_table.json.biom”)

mp0=import\u biom(biom1,parseFunction=parse\u taxonomy\u greengenes)


来自
phyloseq
软件包的税表(mp0)
绘图条使用
ggplot
进行绘图。通过在控制台中键入
plot\u bar
,可以查看
plot\u bar
的代码,这将产生:

function (physeq, x = "Sample", y = "Abundance", fill = NULL, title = NULL, 
          facet_grid = NULL) {
    mdf = psmelt(physeq)
    p = ggplot(mdf, aes_string(x = x, y = y, fill = fill))
    p = p + geom_bar(stat = "identity", position = "stack", color = "black")
    p = p + theme(axis.text.x = element_text(angle = -90, hjust = 0))
    if (!is.null(facet_grid)) {
        p <- p + facet_grid(facet_grid)
    }
    if (!is.null(title)) {
        p <- p + ggtitle(title)
    }
    return(p)
}
color=“black”
参数是导致黑线的原因。这是一个非常基本的条形图,您可以根据以下代码创建自己的函数:

library(phyloseq)

my_plot_bar = function (physeq, x = "Sample", y = "Abundance", fill = NULL, title = NULL, 
                        facet_grid = NULL) {
    mdf = psmelt(physeq)
    p = ggplot(mdf, aes_string(x = x, y = y, fill = fill))
    p = p + geom_bar(stat = "identity", position = "stack")
    p = p + theme(axis.text.x = element_text(angle = -90, hjust = 0))
    if (!is.null(facet_grid)) {
        p <- p + facet_grid(facet_grid)
    }
    if (!is.null(title)) {
        p <- p + ggtitle(title)
    }
    return(p)
}

我试图用谷歌搜索你的绘图功能的名称,但没有找到任何东西。它来自哪里?如果这是您编写的函数,请显示代码和一些示例数据。如果这是程序包中的函数,请包含该程序包。假设您的函数使用ggplot,它是否包含以下语句:
geom\u bar(color=“black”)
?如果是这样,删除
color=“black”
将删除条形部分上的黑色轮廓。它使用Phyloseq软件包。
library(phyloseq)

my_plot_bar = function (physeq, x = "Sample", y = "Abundance", fill = NULL, title = NULL, 
                        facet_grid = NULL) {
    mdf = psmelt(physeq)
    p = ggplot(mdf, aes_string(x = x, y = y, fill = fill))
    p = p + geom_bar(stat = "identity", position = "stack")
    p = p + theme(axis.text.x = element_text(angle = -90, hjust = 0))
    if (!is.null(facet_grid)) {
        p <- p + facet_grid(facet_grid)
    }
    if (!is.null(title)) {
        p <- p + ggtitle(title)
    }
    return(p)
}
my_plot_bar(mp3, "Sampletype", fill = "Family", title = title)