I am trying t o plot a bar plot using ggplot2
as follows:
library(ggplot2)
ggplot(mtcars, aes(factor(carb))) +
geom_bar() +
coord_flip()
<
Perhaps something along these lines where you overlay the wider shaded bars, which vary in color, with the darker smaller bar?
ggplot(mtcars, aes(factor(carb))) +
geom_bar(width = 1.1, aes(x = factor(carb), fill = ifelse(mtcars$carb %in% c(1,3,6), "blue", "transparent"))) +
guides(fill = FALSE) +
geom_bar(width = 0.7) +
scale_fill_manual(values = c("transparent", "blue")) +
coord_flip()