Skip to content

Commit

Permalink
Set ggally_count fill color to GeomRect fill color (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
schloerke committed May 30, 2020
1 parent 11e3846 commit 4a41d4c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ S3method(print,ggmatrix)
S3method(print,glyphplot)
S3method(print,legend_guide_box)
S3method(str,ggmatrix)
export(StatGgallyCount)
export(StatGGallyCount)
export(add_ggproto_to_ggmatrix)
export(add_ref_boxes)
export(add_ref_lines)
Expand Down
9 changes: 5 additions & 4 deletions R/gg-plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -1402,8 +1402,9 @@ ggally_count <- function(data, mapping, ...) {

# default values
args <- list(...)
if (!"fill" %in% names(args) & is.null(mapping$fill))
args$fill <- "grey50"
if (!"fill" %in% names(args) & is.null(mapping$fill)) {
args$fill <- GeomRect$default_aes$fill
}

ggplot(data, mapping) +
do.call(stat_ggally_count, args) +
Expand Down Expand Up @@ -1443,7 +1444,7 @@ stat_ggally_count <- function(mapping = NULL, data = NULL,
layer(
data = data,
mapping = mapping,
stat = StatGgallyCount,
stat = StatGGallyCount,
geom = geom,
position = position,
show.legend = show.legend,
Expand All @@ -1456,7 +1457,7 @@ stat_ggally_count <- function(mapping = NULL, data = NULL,
#' @format NULL
#' @usage NULL
#' @export
StatGgallyCount <- ggproto("StatGgallyCount", Stat,
StatGGallyCount <- ggproto("StatGGallyCount", Stat,
required_aes = c("x", "base_y"),
default_aes = aes(
weight = 1,
Expand Down
2 changes: 1 addition & 1 deletion man/ggally_count.Rd

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

0 comments on commit 4a41d4c

Please sign in to comment.