Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discarding boxplot outliers #5379

Merged
merged 5 commits into from
Aug 7, 2023
Merged

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #4892.

Briefly it adds an outliers switch to geom_boxplot() that can turn outliers on or off, in a manner that does affect the scale ranges, in contrast to setting outliers.shape = NA.

Small demo:

devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2

ggplot(mpg, aes(hwy, class)) +
  geom_boxplot(outliers = FALSE)

Created on 2023-08-03 with reprex v2.0.2

Comment on lines +40 to +41
#' only, not the full data range. If outliers need to be hidden and the axes
#' needs to show the full data range, please use `outlier.shape = NA` instead.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It felt more appropriate to distinguish discarding vs hiding here than to keep the documentation over at the outlier.shape paragraph.

Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@teunbrand teunbrand merged commit df1b901 into tidyverse:main Aug 7, 2023
12 checks passed
@teunbrand teunbrand deleted the boxplot_outliers branch August 7, 2023 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

geom_boxplot outliers
2 participants