I have a dataframe df
:
df <- data.frame (group = c("east", "west"),
value = c(1/3, 2/3)
)
d <- data.frame(x = rep(df$value, times = c(2,1))) %>%
ggplot(aes(x = x, y = 1, fill = x)) +
geom_col(position = 'stack', color = 'white', linewidth = 0.1, width = 1) +
scale_y_continuous(limits = c(-5, 5)) +
theme_void()
I got the following warning message:
`position_stack()` requires non-overlapping x intervals
The plot I got is like this. But I want the blue bars to be stacked on top of another and have the same width, with the dark blue part taking 1/3 of the width and the light blue part taking 2/3.
Also, how can I get rid of the warning message?