Please don't close this and tell me the answer is on Remove space between plotted data and the axes because that is not the same plot and does not work here. Using expand makes the bar large.
My original issue was too much panel which is detailed below and I solved using
library(patchwork)
plot11f + plot_layout(ncol = 1,nrow =5)
I was able to get the nice skinny plot with less grey, but when in my markdown document it has a big white space under it. Using plot.margins doesn't help, it chops off my axis labels and still gives the big white space.
--- Original question --- I have produced the following ggplot (code and dummy data below) but I want to reduce the height of the grey panel bits (where I have scribbled in red) to make the graph shorter (I might even shrink the width of the bar further but need to know how to reduce the grey background panel first).
tableq11f<-data.frame(Q11f<-c("A","B","C","D","E"), percent<-c(0.03,0.07,0.22,0.46,0.22))
plot11f<-ggplot(data=tableq11, aes(x=percent, y="Q11", fill=Q11f))+
geom_col(position = "fill", show.legend = FALSE, width=0.5)+
scale_fill_brewer(palette="Blues")+theme(axis.title.x=element_blank(),
axis.title.y=element_blank(),axis.text.y=element_blank(),axis.ticks.y=element_blank())+
scale_x_continuous(labels = scales::percent)
More like this