Skip to content

Commit

Permalink
ggbarplot: texts are well dodged now
Browse files Browse the repository at this point in the history
  • Loading branch information
kassambara committed Oct 29, 2017
1 parent 771f1ab commit 2aaafb0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/ggbarplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,11 @@ ggbarplot_core <- function(data, x, y,
data_sum <- data_sum %>%
dplyr::arrange_(.dots = list(x, paste0("desc(", color.var, ")")))

group <- intersect(.cols, names(data))[1]# You should specify group for dodging text

p <- p + geom_exec(geom_text, data = data_sum, label = .lab, #fill = lab.fill
vjust = lab.vjust, hjust = lab.hjust, size = lab.size, color = lab.col,
fontface = "plain", position = position)
fontface = "plain", position = position, group = group)
}
else{

Expand All @@ -353,7 +355,6 @@ ggbarplot_core <- function(data, x, y,
fontface = "plain", position = position)
}
}

# To do
# top10, visualizing error
p <- ggpar(p, palette = palette, ggtheme = ggtheme,
Expand Down

0 comments on commit 2aaafb0

Please sign in to comment.