Skip to content

Commit

Permalink
merge pr #526: allow fill = NULL in shade_*() functions
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch authored Mar 25, 2024
2 parents 2c5e800 + 71454e6 commit 6bc4fbe
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Addresses ggplot2 warnings when shading p-values for test statistics
that are outside of the range of the generated distribution (#528).

* Fixed bug in `shade_p_value()` and `shade_confidence_interval()` where `fill = NULL` was ignored when it was documented as preventing any shading (#525).

# infer v1.0.6

* Updated infrastructure for errors, warnings, and messages (#513). Most of these changes will not be visible to users, though:
Expand Down
2 changes: 1 addition & 1 deletion R/shade_confidence_interval.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ shade_confidence_interval <- function(endpoints, color = "mediumaquamarine",
fn = "shade_confidence_interval",
endpoints = if (is.null(endpoints)) {NA} else {endpoints},
color = color,
fill = fill,
fill = list(fill),
dots = list(...)
)
}
Expand Down
2 changes: 1 addition & 1 deletion R/shade_p_value.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ shade_p_value <- function(obs_stat, direction,
obs_stat = if (is.null(obs_stat)) {NA} else {obs_stat},
direction = if (is.null(direction)) {NA} else {direction},
color = color,
fill = fill,
fill = list(fill),
dots = list(...)
)
}
Expand Down
1 change: 1 addition & 0 deletions R/visualize.R
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ ggplot_add.infer_layer <- function(object, plot, object_name) {
shade_fn <- attr(object, "fn")
shade_args <- attributes(object)[!names(attributes(object)) %in%
c("class", "fn")]
shade_args["fill"] <- shade_args[["fill"]]

# if a patchwork object, use a custom `infer_layer` `+.gg` method.
# otherwise, convert the `infer_layer` back to a list and call `+` again.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6bc4fbe

Please sign in to comment.