Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix barplot axis window/panel margin and labels. #109

Open
grabear opened this issue Oct 21, 2020 · 0 comments
Open

Fix barplot axis window/panel margin and labels. #109

grabear opened this issue Oct 21, 2020 · 0 comments

Comments

@grabear
Copy link
Member

grabear commented Oct 21, 2020

From

MicrobiomeR/R/barplot.R

Lines 99 to 106 in dfc8f67

# Create the theme
p <- p + ggplot2::ylab("Relative Abundance (% 100)") + ggplot2::scale_fill_manual(values = palette_values) + ggplot2::theme(
text = ggplot2::element_text(size = 11, face = "bold"),
axis.text.x = ggplot2::element_blank(), axis.ticks = ggplot2::element_blank(), panel.grid.major = ggplot2::element_blank(), panel.grid.minor = ggplot2::element_blank(),
strip.background = ggplot2::element_rect(fill = "white"), strip.text = ggplot2::element_text(colour = "black"), panel.background = ggplot2::element_blank()
) +
ggplot2::xlab(xlabel) +
ggplot2::scale_y_continuous(breaks = scales::pretty_breaks(n = 4))

The axis.text.x = ggplot2::element_blank(), part can be removed and expand = c(0,0) can be added to scale_y_continuous for formatting the axis.

@grabear grabear changed the title Fix barplot axis window and labels. Fix barplot axis window/panel margin and labels. Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant