I found this How to place labels above geom_bar in R using ggplot2 , but just placed labels (numbers) on just one line.
Here, for example, two bars for each x axis, how to do the same?
My data and code are as follows:
dat <- read.table(text = "sample Types Number sample1 A 3641 sample2 A 3119 sample1 B 15815 sample2 B 12334 sample1 C 2706 sample2 C 3147", header=TRUE) library(ggplot2) bar <- ggplot(data=dat, aes(x=Types, y=Number, fill=sample)) + geom_bar(position = 'dodge') + geom_text(aes(label=Number))
Then we get: 
Numeric texts also seem to be located in the "evasion" pattern. I searched the geom_text manual to find some information, but can't make it work.
Suggestions?
r ggplot2 bar-chart
Puriney Aug 18 '12 at 12:20 2012-08-18 12:20
source share