Skip to content

geom_boxplot fill passed onto outliers #1785

Closed
@schloerke

Description

@schloerke

Is it possible to pass the fill value form geom_boxplot aesthetic to the outlier fill color? This would allow the fill of the outlier points to match the fill of the box plot if the point is set to a shape that allows for a fill.

Line https://github.com/hadley/ggplot2/blob/master/R/geom-boxplot.r#L211 could be something like

# definition
outlier.fill = NULL,
...

# outlier data.frame
fill = outlier.fill %||% data$fill[1]

The example would be

ggplot(iris, aes(Species, Sepal.Length, fill = Species)) + geom_boxplot(outlier.shape = 21)

screen shot 2016-09-27 at 3 46 25 pm

The legend isn't correct, but the desired output would be something like...

ggplot(iris, aes(Species, Sepal.Length)) + geom_boxplot(mapping = aes(color = Species)) + geom_boxplot(outlier.shape = 21, fill = NULL)

screen shot 2016-09-27 at 3 45 49 pm

Thank you,
Barret

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions