# NOT RUN {
library(ggplot2)
mtcars$gear <- factor(mtcars$gear)
bp <- ggplot(
data = mtcars,
aes(x = gear, fill = gear)
) +
geom_bar() +
ggtitle("Number of Cars by Gears") +
xlab("Gears")
gggap(
plot = bp,
ylim = c(0, 16),
segments = c(6, 8)
)
gggap_legend(
plot = bp,
margin = c(top = 1, right = 1, bottom = 1, left = 460)
)
# }
Run the code above in your browser using DataLab