Q:

Can you adjust the width of a single stacked bar chart with ggplot2? 

I would like to make the bar chart from the code below narrower. 
df <- data.frame(
      names = LETTERS[1:4],
      vals = c(25, 20, 30, 25))

ggplot(df,aes(1,y=vals,fill=names)) +
  geom_bar(stat="identity")

I have tried to fix this using width in the ggplot command, but it seems that this only works if there are multiple bars.  Thanks

A:

Convert the 1 to a factor and change the width
ggplot(df, aes(as.factor(1), vals, fill = names)) +
  geom_col(width = .3)

Note that instead of geom_bar with argument stat = identity you can use geom_col. 