Skip to content

Commit 0876fb6

Browse files
teunbrandthomasp85
authored andcommitted
drop empty panels from bar width calculation (#5633)
1 parent 31b01aa commit 0876fb6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/geom-bar.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ GeomBar <- ggproto("GeomBar", GeomRect,
145145
data <- flip_data(data, params$flipped_aes)
146146
data$width <- data$width %||%
147147
params$width %||% (min(vapply(
148-
split(data$x, data$PANEL),
148+
split(data$x, data$PANEL, drop = TRUE),
149149
resolution, numeric(1), zero = FALSE
150150
)) * 0.9)
151151
data$just <- params$just %||% 0.5

0 commit comments

Comments
 (0)