I have a a dataset with 3 columns called df
Name
, value
, Freq
I have constructed a graph with geom_bar()
& geom_text()
function
ggplot(df, aes(x=name, fill=value, y=Freq)) + geom_bar(stat = "identity") + geom_text(aes(label=Freq))
with the output:
How would i be able to sort out the confused text label placement?
Any help would be greatly appreciated. Thanks.
Try this:
library(ggplot2)
#Code
ggplot(df, aes(x=name, fill=value, y=Freq)) +
geom_bar(stat = "identity") +
geom_text(aes(label=Freq),position = position_stack(0.9))