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/
569 stars 187 forks source link

lines on barplot #1640

Open metageno67 opened 1 year ago

metageno67 commented 1 year ago

hi on the barplots, is it possible to have no separation lines between taxa, when using the plot_bar command?

david-barnett commented 1 year ago

You might like to try the package microViz, which uses phyloseq objects and makes it easier to make modifications like your request (disclaimer, I'm the maintainer)

library(microViz)
#> microViz version 0.10.3 - Copyright (C) 2022 David Barnett
#> ! Website: https://david-barnett.github.io/microViz
#> ✔ Useful?  For citation details, run: `citation("microViz")`
#> ✖ Silence? `suppressPackageStartupMessages(library(microViz))`

# get some example phyloseq data 
data("shao19")

# subset samples for a smaller dataset
psq <- shao19 %>% ps_filter(age == 38) 

# by default there are black borders to each bar
comp_barplot(psq, tax_level = "genus") + ggplot2::coord_flip()


# remove the borders like this
comp_barplot(psq, tax_level = "genus", bar_outline_colour = NA) +
  ggplot2::coord_flip()

Created on 2022-11-18 with reprex v2.0.2

See more examples here: https://david-barnett.github.io/microViz/articles/web-only/compositions.html

metageno67 commented 1 year ago

Thanks for the answer and for this very nice and very useful package!

Le 18 nov. 2022 à 13:48, David Barnett @.***> a écrit :

You might like to try the package microViz https://david-barnett.github.io/microViz, which uses phyloseq objects and makes it easier to make modifications like your request (disclaimer, I'm the maintainer)

library(microViz)

> microViz version 0.10.3 - Copyright (C) 2022 David Barnett

> ! Website: https://david-barnett.github.io/microViz

> ✔ Useful? For citation details, run: citation("microViz")

> ✖ Silence? suppressPackageStartupMessages(library(microViz))

get some example phyloseq data

data("shao19")

subset samples for a smaller dataset

psq <- shao19 %>% ps_filter(age == 38)

by default there are black borders to each bar

comp_barplot(psq, tax_level = "genus") + ggplot2::coord_flip() https://camo.githubusercontent.com/74e53ea3bf61a5c601592dc106a167a47ae8134a06911a3232a9059aeb7fb029/68747470733a2f2f692e696d6775722e636f6d2f4b6a39375043692e706e67

remove the borders like this

comp_barplot(psq, tax_level = "genus", bar_outline_colour = NA) + ggplot2::coord_flip() https://camo.githubusercontent.com/6bb0037a6df4cd1daa14b740c8f66662174ebf5559118c7cd51c9040049921b1/68747470733a2f2f692e696d6775722e636f6d2f774f306e665a772e706e67 Created on 2022-11-18 with reprex v2.0.2 https://reprex.tidyverse.org/ See more examples here: https://david-barnett.github.io/microViz/articles/web-only/compositions.html https://david-barnett.github.io/microViz/articles/web-only/compositions.html — Reply to this email directly, view it on GitHub https://github.com/joey711/phyloseq/issues/1640#issuecomment-1319951815, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4HWQALY7N7CEHQ5C5XYZ4TWI53JRANCNFSM6AAAAAASDLNDYU. You are receiving this because you authored the thread.