Skip to content

Commit a92433e

Browse files
authored
pad area coordinates only with needed ggplot_build() data (#467)
1 parent 7edd275 commit a92433e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1475
-1236
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
To be released as infer v1.0.4.
44

5+
* Fixed bug in p-value shading where shaded regions no longer correctly overlaid
6+
histogram bars.
7+
58
# infer v1.0.3
69

710
* Fix R-devel HTML5 NOTEs.

R/shade_p_value.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ hist_area <- function(data, obs_stat, direction, yval) {
336336
# "almost vertical" lines with `geom_area()` usage. If don't do this, then
337337
# area might be shaded under line segments connecting edges of consequtive
338338
# histogram bars.
339-
x_extra <- sort(c(x, g_data[["xmin"]], g_data[["xmax"]]))
339+
x_extra <- switch(direction, left = g_data[["xmax"]], right = g_data[["xmin"]])
340+
x_extra <- sort(c(x, x_extra))
340341
x_grid <- switch(
341342
# `direction` can be one of "left" or "right" at this point of execution
342343
direction,

tests/testthat/_snaps/shade_confidence_interval/ci-both-fill.svg

Lines changed: 16 additions & 16 deletions
Loading

tests/testthat/_snaps/shade_confidence_interval/ci-both-nofill.svg

Lines changed: 16 additions & 16 deletions
Loading

0 commit comments

Comments
 (0)