Skip to content

Commit 4daf282

Browse files
committed
fix: fixed inset scale range when facet.y.scale='fixed'
1 parent a231ece commit 4daf282

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

R/geom_coverage.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,10 @@ geom_coverage <- function(data, mapping = NULL, color = NULL, rect.color = NA,
240240
# prepare facet scale
241241
if (facet.y.scale == "free") {
242242
facet.ys <- "free_y"
243+
data.range <- dplyr::group_by(data, .data[[facet.key]])
243244
} else if (facet.y.scale == "fixed") {
244245
facet.ys <- "fixed"
246+
data.range <- data
245247
}
246248
region.facet <- facet_wrap2(
247249
facets = facet.formula, ncol = 1, scales = facet.ys, strip.position = "right",
@@ -257,8 +259,7 @@ geom_coverage <- function(data, mapping = NULL, color = NULL, rect.color = NA,
257259
}
258260

259261
if (range.position == "in") {
260-
data.range <- data %>%
261-
dplyr::group_by(.data[[facet.key]]) %>%
262+
data.range <- data.range %>%
262263
dplyr::summarise(.groups = "drop_last",
263264
min_score = pretty(.data[[ymax.str]])[1],
264265
max_score = tail(pretty(.data[[ymax.str]]), 1)

0 commit comments

Comments
 (0)