How to write values on bars using mtext?
# Grouped Bar Plot
counts <- table(mtcars$vs, mtcars$gear)
barplot(counts, main="Car Distribution by Gears and VS",xlab="Number of Gears", col=c("darkblue","red"),legend = rownames(counts), beside=TRUE, horiz=TRUE)
mtext(counts ) # But position is not at each bar.
How can I put corresponding values on each bar plot?
Well,
mtextis generally use for margins. Is there a reason you do not want to usetext?