Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Specify alpha for outlier points in geom_boxplot. #1644
Merged
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
57faddd
Added outlier.alpha to options for geom_boxplot.
jonathan-g cb741f8
Roll back development version number
jonathan-g 5edecf9
Merge pull request #1 from hadley/master
jonathan-g e34868a
Update NEWS
jonathan-g cd62410
Made changes requested by Hadley.
jonathan-g 32a2790
Fixed one last place where I set outlier.alpha to NA instead of NULL …
jonathan-g 6eb9b36
Corrected whitespace in news.md item.
jonathan-g 6ca172f
Merge branch 'master' of https://github.com/hadley/ggplot2
jonathan-g c61acfe
Cleaned up old NEWS file (moved note about outlier.alpha for geom_box…
jonathan-g f8c264d
Merged with latest from hadley.
jonathan-g
Jump to file or symbol
Failed to load files and symbols.
| @@ -26,7 +26,7 @@ | ||
| #' @inheritParams geom_point | ||
| #' @param geom,stat Use to override the default connection between | ||
| #' \code{geom_boxplot} and \code{stat_boxplot}. | ||
| -#' @param outlier.colour,outlier.color,outlier.shape,outlier.size,outlier.stroke | ||
| +#' @param outlier.colour,outlier.color,outlier.shape,outlier.size,outlier.stroke,outlier.alpha | ||
| #' Default aesthetics for outliers. Set to \code{NULL} to inherit from the | ||
| #' aesthetics used for the box. | ||
| #' | ||
| @@ -67,6 +67,8 @@ | ||
| #' geom_boxplot() | ||
| #' ggplot(diamonds, aes(carat, price)) + | ||
| #' geom_boxplot(aes(group = cut_width(carat, 0.25))) | ||
| +#' ggplot(diamonds, aes(carat, price)) + | ||
| +#' geom_boxplot(aes(group = cut_width(carat, 0.25)), outlier.alpha = 0.1) | ||
| #' | ||
| #' \donttest{ | ||
| #' # It's possible to draw a boxplot with your own computations if you | ||
| @@ -94,6 +96,7 @@ geom_boxplot <- function(mapping = NULL, data = NULL, | ||
| outlier.shape = 19, | ||
| outlier.size = 1.5, | ||
| outlier.stroke = 0.5, | ||
| + outlier.alpha = NULL, | ||
| notch = FALSE, | ||
| notchwidth = 0.5, | ||
| varwidth = FALSE, | ||
| @@ -113,6 +116,7 @@ geom_boxplot <- function(mapping = NULL, data = NULL, | ||
| outlier.shape = outlier.shape, | ||
| outlier.size = outlier.size, | ||
| outlier.stroke = outlier.stroke, | ||
| + outlier.alpha = outlier.alpha, | ||
| notch = notch, | ||
| notchwidth = notchwidth, | ||
| varwidth = varwidth, | ||
| @@ -160,6 +164,7 @@ GeomBoxplot <- ggproto("GeomBoxplot", Geom, | ||
| draw_group = function(data, panel_scales, coord, fatten = 2, | ||
| outlier.colour = NULL, outlier.shape = 19, | ||
| outlier.size = 1.5, outlier.stroke = 0.5, | ||
| + outlier.alpha = NULL, | ||
| notch = FALSE, notchwidth = 0.5, varwidth = FALSE) { | ||
| common <- data.frame( | ||
| @@ -204,7 +209,7 @@ GeomBoxplot <- ggproto("GeomBoxplot", Geom, | ||
| size = outlier.size %||% data$size[1], | ||
| stroke = outlier.stroke %||% data$stroke[1], | ||
| fill = NA, | ||
| - alpha = NA, | ||
| + alpha = outlier.alpha %||% data$alpha[1], | ||
jonathan-g
Contributor
|
||
| stringsAsFactors = FALSE | ||
| ) | ||
| outliers_grob <- GeomPoint$draw_panel(outliers, panel_scales, coord) | ||
Some generated files are not rendered by default. Learn more.
Oops, something went wrong.
%||%works withNULLnotNA. I think that just means the default function param above should be NULL.