Skip to content

Commit

Permalink
fix for #106
Browse files Browse the repository at this point in the history
  • Loading branch information
kassambara committed Aug 23, 2018
1 parent 7b88e2d commit de2acee
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

## Bug fixes

- Now, `ggscatter()` can remove the letter 'a' from the legend, when the argument `show.legend.text = FALSE` specified [@atsyplenkov, #106](https://github.com/kassambara/ggpubr/issues/106).
- Now, adding a `size` option to ggscatter `add.params` is supported [@retrogenomics, #94](https://github.com/kassambara/ggpubr/issues/53).

# ggpubr 0.1.7
Expand Down
9 changes: 6 additions & 3 deletions R/ggtext.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ NULL
#' @param face text font style. Allowed values are one of c("plain", "bold",
#' "italic", "bold.italic").
#' @param family character vector specifying font family.
#' @param show.legend logical. Should text be included in the legends? NA,
#' the default, includes if any aesthetics are mapped. FALSE never includes,
#' and TRUE always includes.
#' @param label.select can be of two formats: \itemize{ \item a character vector
#' specifying some labels to show. \item a list containing one or the
#' combination of the following components: \itemize{ \item \code{top.up} and
Expand Down Expand Up @@ -60,7 +63,7 @@ NULL
#' @export
ggtext <- function(data, x = NULL, y = NULL, label = NULL,
color = "black", palette = NULL,
size = 11, face = "plain", family = "",
size = 11, face = "plain", family = "", show.legend = NA,
label.select = NULL, repel = FALSE, label.rectangle = FALSE,
grouping.vars = NULL,
position = "identity",
Expand Down Expand Up @@ -128,7 +131,7 @@ ggtext <- function(data, x = NULL, y = NULL, label = NULL,
if(label.rectangle) ggfunc <- ggrepel::geom_label_repel
p <- p + geom_exec(ggfunc, data = lab_data, x = x, y = y,
label = label, fontface = face,
family = family,
family = family, show.legend = show.legend,
size = size/3, color = color,
alpha = alpha,
box.padding = unit(0.35, "lines"),
Expand All @@ -146,7 +149,7 @@ ggtext <- function(data, x = NULL, y = NULL, label = NULL,
vjust <- ifelse(is.null(.dots$vjust), vjust, .dots$vjust)
if(!is.null(.dots$hjust)) hjust <- .dots$hjust
p <- p + geom_exec(ggfunc, data = lab_data, x = x, y = y, color = color,
label = label, fontface = face, family = family,
label = label, fontface = face, family = family, show.legend = show.legend,
size = size/3, color = color,
vjust = vjust, hjust = hjust, alpha = alpha, position = position)

Expand Down
4 changes: 3 additions & 1 deletion R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ p
label.select = NULL, repel = FALSE, label.rectangle = FALSE,
ggtheme = theme_pubr(),
fun_name = "", group = 1, # used only by ggline
show.legend.text = NA,
...)
{

Expand Down Expand Up @@ -942,7 +943,8 @@ p
.add_item(data = data, x = opts$x, y = opts$y,
label = label, label.select = label.select,
repel = repel, label.rectangle = label.rectangle, ggtheme = NULL,
grouping.vars = grouping.vars, facet.by = facet.by, position = geom.text.position)
grouping.vars = grouping.vars, facet.by = facet.by, position = geom.text.position,
show.legend = show.legend.text)
p <- purrr::map(p,
function(p, label.opts){
. <- NULL
Expand Down
10 changes: 7 additions & 3 deletions man/ggtext.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit de2acee

Please sign in to comment.