Skip to content

Commit

Permalink
fix #165 + remove legend title by default
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperSkytte committed Jan 17, 2024
1 parent b702c37 commit 7ecb30e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: ampvis2
Type: Package
Title: Tools for visualising amplicon data
Description: ampvis2 is a small set of tools that allows effortless visualisation of amplicon data.
Version: 2.8.6
Version: 2.8.7
Authors@R: c(
person(
c("Kasper", "Skytte"), "Andersen",
Expand Down
13 changes: 6 additions & 7 deletions R/amp_boxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,20 @@ amp_boxplot <- function(data,
}

## plot the data
if (group_by == sampleIDvarname) {
p <- ggplot(abund7, aes(x = Display, y = Sum))
if (!is.null(order_group)) {
abund7$.Group <- factor(abund7$.Group, levels = rev(order_group))
}
if (group_by != sampleIDvarname) {
if (!is.null(order_group)) {
abund7$.Group <- factor(abund7$.Group, levels = rev(order_group))
}
if (all(group_by %in% sampleIDvarname))
p <- ggplot(abund7, aes(x = Display, y = Sum))
else
p <- ggplot(abund7, aes(x = Display, y = Sum, color = .Group))
}

p <- p +
guides(col = guide_legend(reverse = TRUE)) +
xlab("") +
theme_classic() +
theme(
legend.title = element_blank(),
panel.grid.major.x = element_line(color = "grey90"),
panel.grid.major.y = element_line(color = "grey90")
)
Expand Down

0 comments on commit 7ecb30e

Please sign in to comment.