Skip to content

Commit 22b8595

Browse files
committed
fix: respect width aesthetic
1 parent bed8e32 commit 22b8595

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

R/stat-boxplot.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ StatBoxplot <- ggproto("StatBoxplot", Stat,
6363
if (any(outliers)) {
6464
stats[c(1, 5)] <- range(c(stats[2:4], data$y[!outliers]), na.rm = TRUE)
6565
}
66-
67-
if (vec_unique_count(data$x) > 1)
66+
if (vec_size(data) > 0L && !is.null(data$width)) {
67+
width <- data$width[1L]
68+
} else if (vec_unique_count(data$x) > 1) {
6869
width <- diff(range(data$x)) * 0.9
70+
}
6971

7072
df <- data_frame0(!!!as.list(stats))
7173
df$outliers <- list(data$y[outliers])

0 commit comments

Comments
 (0)