Skip to content

Commit 9e4218a

Browse files
schloerkehadley
authored andcommitted
outlier.fill added to geom_boxplot
Closes #1787. Fixes #1785.
1 parent a31aec5 commit 9e4218a

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# ggplot2 2.1.0.9000
22

3+
* `geom_boxplot()` gain new `outlier.fill` argument for controlling the fill of
4+
outlier points independently of the alpha of the boxes, analogous to
5+
`outlier.colour`, `outlier.shape`, etc (@schloerke, #1787).
6+
37
* Scales worry less about having breaks. If no breaks can be computed, the
48
plot will work instead of throwing an uninformative error (#791).
59

R/geom-boxplot.r

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#' @inheritParams geom_point
2727
#' @param geom,stat Use to override the default connection between
2828
#' \code{geom_boxplot} and \code{stat_boxplot}.
29-
#' @param outlier.colour,outlier.color,outlier.shape,outlier.size,outlier.stroke,outlier.alpha
29+
#' @param outlier.colour,outlier.color,outlier.fill,outlier.shape,outlier.size,outlier.stroke,outlier.alpha
3030
#' Default aesthetics for outliers. Set to \code{NULL} to inherit from the
3131
#' aesthetics used for the box.
3232
#'
@@ -93,6 +93,7 @@ geom_boxplot <- function(mapping = NULL, data = NULL,
9393
...,
9494
outlier.colour = NULL,
9595
outlier.color = NULL,
96+
outlier.fill = NULL,
9697
outlier.shape = 19,
9798
outlier.size = 1.5,
9899
outlier.stroke = 0.5,
@@ -113,6 +114,7 @@ geom_boxplot <- function(mapping = NULL, data = NULL,
113114
inherit.aes = inherit.aes,
114115
params = list(
115116
outlier.colour = outlier.color %||% outlier.colour,
117+
outlier.fill = outlier.fill,
116118
outlier.shape = outlier.shape,
117119
outlier.size = outlier.size,
118120
outlier.stroke = outlier.stroke,
@@ -162,7 +164,8 @@ GeomBoxplot <- ggproto("GeomBoxplot", Geom,
162164
},
163165

164166
draw_group = function(data, panel_scales, coord, fatten = 2,
165-
outlier.colour = NULL, outlier.shape = 19,
167+
outlier.colour = NULL, outlier.fill = NULL,
168+
outlier.shape = 19,
166169
outlier.size = 1.5, outlier.stroke = 0.5,
167170
outlier.alpha = NULL,
168171
notch = FALSE, notchwidth = 0.5, varwidth = FALSE) {
@@ -205,6 +208,7 @@ GeomBoxplot <- ggproto("GeomBoxplot", Geom,
205208
y = data$outliers[[1]],
206209
x = data$x[1],
207210
colour = outlier.colour %||% data$colour[1],
211+
fill = outlier.fill %||% data$fill[1],
208212
shape = outlier.shape %||% data$shape[1],
209213
size = outlier.size %||% data$size[1],
210214
stroke = outlier.stroke %||% data$stroke[1],

man/geom_boxplot.Rd

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)