Dear all,
I am using ggplot to get bar graphs for four different firm size classes for three different firm types (Manufacturing, Trading, Services) . On the x-axis I have firm size classes and the values for the different firm types on the y-axis. I want to get the exact value on top of each bar but I don't know how to do it. I always get the following error:
Error: geom_text requires the following missing aesthetics: x
Does anyone know how I can fix this and get the values on top of my bars?
Thank you very much in advance for your time and your help!
ggplot(average_taxgain_reshaped) +
geom_col(aes(x=reorder(company_size, -value),
y = value,
fill = variable),
position = "dodge") +
geom_text(aes(y = value, label = value), vjust = 1.5) +
ylab("") +
xlab("") +
scale_fill_manual(values = c(Trading = "salmon3",
Manufacturing = "navajowhite1",
Services = "palegreen3"),
name = "Firm Type") +
theme_light()